Hi!
Is it possible to create CSV log file with header name and in next row with columns names.
something like that
SomeString
Column1,Column2,Column3
Value1,Value2,Value3
Value4,Value5,Value6
Type: Question
NLog version: 4.3.4
Platform: .Net 4.5.2
I tried something like that, but if I put header in layout tag then I'll get only "SomeString" without columns names.
Current NLog config
<target name="AppLog" xsi:type="File" fileName="${basedir}/AppLog.csv" encoding="utf-8">
<layout xsi:type="CsvLayout" delimiter="Comma" withHeader="true" header="SomeString">
<column name="Column1" layout="${longdate}" />
<column name="Column2" layout="${windows-identity}" />
<column name="Column3" layout="" />
</layout>
</target>
Too bad that isn't possible. If you send a feature request, please think how we should configure it (backwards-compatible)
@304NotModified How about
header="SomeString${newline}Column1,Column2,Column3"
Of course the column names are then hard-coded into the string, but at least it does the job, or am I missing something?
That's a nice work around :)
That's working exactly how I wanted, Thank you very much!
Most helpful comment
@304NotModified How about
Of course the column names are then hard-coded into the string, but at least it does the job, or am I missing something?