Repeated header line

classic Classic list List threaded Threaded
5 messages Options
Bo
Reply | Threaded
Open this post in threaded view
|

Repeated header line

Bo
I can't seem to get the header to stop printing every time my program runs.  Here's my config:

    <targets>
      <target name="file" xsi:type="File"
              fileName="${basedir}/logs/${shortdate}.txt"
              concurrentWrites="true"
              archiveEvery="Day"
              header="false">
        <layout xsi:type="CsvLayout" delimiter="Tab">
          <withHeader>false</withHeader>
          <column name="date" layout="${longdate}"/>
          <column name="logger" layout="${logger}"/>
          <column name="message" layout="${message}"/>
          <column name="exception" layout="${exception:format=tostring}" />
        </layout>
      </target>
    </targets>

    <rules>
      <logger name="*" minlevel="Debug" writeTo="file" />
    </rules>



if I repeatedly run:
            logger.Info("hello");

The results are:
date logger message exception
2011-04-17 14:34:44.3578 xxx.Program hello
date logger message exception
2011-04-17 14:34:52.5788 xxx.Program hello
date logger message exception
2011-04-17 14:34:57.4178 xxx.Program hello

Reply | Threaded
Open this post in threaded view
|

RE: Repeated header line

Jarek Kowalski
Administrator
Which build are you using? This should be fixed in latest nightly builds.

Sent from my Windows Phone

From: Bo [via NLog Forum]
Sent: Sunday, April 17, 2011 2:37 PM
To: Jarek Kowalski
Subject: Repeated header line

I can't seem to get the header to stop printing every time my program runs.  Here's my config:

    <targets>
      <target name="file" xsi:type="File"
              fileName="${basedir}/logs/${shortdate}.txt"
              concurrentWrites="true"
              archiveEvery="Day"
              header="false">
        <layout xsi:type="CsvLayout" delimiter="Tab">
          <withHeader>false</withHeader>
          <column name="date" layout="${longdate}"/>
          <column name="logger" layout="${logger}"/>
          <column name="message" layout="${message}"/>
          <column name="exception" layout="${exception:format=tostring}" />
        </layout>
      </target>
    </targets>

    <rules>
      <logger name="*" minlevel="Debug" writeTo="file" />
    </rules>



if I repeatedly run:
            logger.Info("hello");

The results are:
date logger message exception
2011-04-17 14:34:44.3578 xxx.Program hello
date logger message exception
2011-04-17 14:34:52.5788 xxx.Program hello
date logger message exception
2011-04-17 14:34:57.4178 xxx.Program hello




If you reply to this email, your message will be added to the discussion below:
http://nlog-forum.1685105.n2.nabble.com/Repeated-header-line-tp6281864p6281864.html
To start a new topic under NLog Forum, email [hidden email]
To unsubscribe from NLog Forum, click here.
NLog Blog
Reply | Threaded
Open this post in threaded view
|

RE: Repeated header line

Carlos Lone
I have the same problem, is this issue already fixed ???

Thanks for your help
Reply | Threaded
Open this post in threaded view
|

RE: Repeated header line

Carlos Lone
I'm using version 2.0.0 for framework 2.0
Reply | Threaded
Open this post in threaded view
|

RE: Repeated header line

daymansiege
In reply to this post by Jarek Kowalski
Jarek Kowalski wrote
Which build are you using? This should be fixed in latest nightly builds.
Jarek,
I use version 2.0 for CF 3.5 and have a similar issue.
During application session everything looks to be fine - it writes headers just once. However, when I start the app again NLog writes headers again after previous records.
Can you give any advise how to fix this?