DBI -> trace

Hi!
I'm using the DBI module for perl. I want to use DBI->trace{2, 'filename')
for tracing database information. I'm forking new processes, and on each
process
I make connection to the database. I write logging infos from each thread to
1.log, 2.log.. etc
My problem is, that I want to add the dbi tracing information to each
thread's logfile, but dbi->trace
generates only a big file in which it concatenates each process' tracing
info..
is there any solution to this? I read the CPAN manual, see the DBI.pm source
code, but can't figure out.
I can't install new modules to the system where perl is running
thank you guys!
rob
Rob Thomp [ Mo, 31 Juli 2006 22:41 ] [ ID #1411982 ]

Re: DBI -> trace

Rob Thomp wrote:
> I'm using the DBI module for perl. I want to use DBI->trace{2, 'filename')

Syntax error. Please copy and paste your code. Do not retype.

> for tracing database information. I'm forking new processes, and on each
> process
> I make connection to the database. I write logging infos from each thread

Each thread? I thought you said you were forking.
Do you have threads or do you have processes?

> to 1.log, 2.log.. etc
> My problem is, that I want to add the dbi tracing information to each
> thread's logfile, but dbi->trace
> generates only a big file in which it concatenates each process' tracing
> info..
> is there any solution to this?

Why not just call DBI->trace in each process *after* the fork has
happened, and generate the filename using the PID of each process?

Paul Lalli
Paul Lalli [ Mo, 31 Juli 2006 23:10 ] [ ID #1411983 ]

Re: DBI -> trace

Sorry. I know the difference between a child process and thread, but usually
I call each of
them "threads".
I've solved it at last. when I start the child processes for each of them I
assign a DBI
tracing with different filenames, as you suggested, thank you!
rob


"Paul Lalli" <mritty [at] gmail.com> az alábbiakat írta a következo hírüzenetben:
1154378664.643121.187700 [at] b28g2000cwb.googlegroups.com...
> Rob Thomp wrote:
>> I'm using the DBI module for perl. I want to use DBI->trace{2,
>> 'filename')
>
> Syntax error. Please copy and paste your code. Do not retype.
>
>> for tracing database information. I'm forking new processes, and on each
>> process
>> I make connection to the database. I write logging infos from each thread
>
> Each thread? I thought you said you were forking.
> Do you have threads or do you have processes?
>
>> to 1.log, 2.log.. etc
>> My problem is, that I want to add the dbi tracing information to each
>> thread's logfile, but dbi->trace
>> generates only a big file in which it concatenates each process' tracing
>> info..
>> is there any solution to this?
>
> Why not just call DBI->trace in each process *after* the fork has
> happened, and generate the filename using the PID of each process?
>
> Paul Lalli
>
Rob Thomp [ Do, 03 August 2006 19:23 ] [ ID #1416455 ]
Perl » alt.perl » DBI -> trace

Vorheriges Thema: Taking Perl input from a java app
Nächstes Thema: Two questions on die{} and writing error to file