Tracing and TraceOptions

Posts   
 
    
yowl
User
Posts: 271
Joined: 11-Feb-2008
# Posted on: 07-Sep-2024 16:05:36   

Hi,

5.10 Adapter

For tracing of SQL Server DQE,e.g

            Trace.Listeners.Add(new TextWriterTraceListener(File.CreateText("tracelog.txt"))
            {
                TraceOutputOptions = TraceOptions.Timestamp | TraceOptions.DateTime, // doesn't work for LLBLgen tracing, perhaps they use WriteLine :-O
            });
            Trace.AutoFlush = true;

It doesn't seem like the options for adding timestamps and the DateTime are observed

ServerObjects.Data.Tests Error: 0 : test
    DateTime=2024-09-07T13:53:09.0035471Z
    Timestamp=2184878884113
Method Enter: CreatePagingSelectDQ
Method Enter: CreateSelectDQ
Method Exit: CreateSelectDQ
Method Exit: CreatePagingSelectDQ: no paging.
SqlServer ready query: 
    Query:
DECLARE @p1 Int
SET @p1=50
DECLARE @p2 Bit
SET @p2=1

SELECT

The only line that has the timestamp and datetime is the test I did with Trace.TraceError("test"); Is there a way we can get the datetime with the DQE traces? It would be helpful to diagnose which part of a large prefetch is slow.

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39727
Joined: 17-Aug-2003
# Posted on: 09-Sep-2024 08:42:21   

We write the trace output with Trace.WriteLine(). So I think in that particular case, the timestamp isn't written to the output.

To determine which part of a large prefetch is slow is easier done with a profiler tho, as that's their main task: show you what's slow. A trace is merely used for low level logging. Writing the datetime/timestamp out isn't a bad idea tho, we'll see if we can add that in the future

Frans Bouma | Lead developer LLBLGen Pro
yowl
User
Posts: 271
Joined: 11-Feb-2008
# Posted on: 09-Sep-2024 16:04:29   

Thanks, that would be good. Especially for Azure Database, where profiling is not an option, (although there are other more lengthy ways).