${cached:} Does not work

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

${cached:} Does not work

Boni
${cached:} Does not work!
I tried with both version 1 and 2 of Nlog.

<target name="file" xsi:type="File" fileName="AFRFRAA${cached:${date:format=yyyyMMdd_hhmmss}}.LOG" />

Results in AFRFRAA.log
and not as expected: AFRFRAA20110802_235612.log


looking forward to your answers
Reply | Threaded
Open this post in threaded view
|

Re: ${cached:} Does not work

Boni
Deos anyone can help?
I am looking for an answer more than a week but there are none.
Please try to help.

Again, my goal is to create one log file inclufing date and time in file name, and using it for the entire runtime of the program. This is instead of creating new log file each minute for example.

Looking forward to any respnse

Best
Reply | Threaded
Open this post in threaded view
|

Re: ${cached:} Does not work

Jarek Kowalski
Administrator
Can you try ${cached:${longdate}:cached=true}?

I don't have access to my dev machine now, since I'm on vacation, but in unit tests this is the syntax that's being used.

Also, make sure you're using NLog 2.0.0.2000 not some earlier release.
NLog Blog
Reply | Threaded
Open this post in threaded view
|

Re: ${cached:} Does not work

Boni
Hi,
I tried this:
<target name="file" xsi:type="File" fileName="AFRFRAA${cached:${longdate}:cached=true}.LOG" />

And the result was log file named: "AFRFRAA.LOG"
I.e., it does not work.

I will wait until you will back from your vacation.
Continue enjoy your vacation!

Best
Reply | Threaded
Open this post in threaded view
|

Re: ${cached:} Does not work

Boni
In reply to this post by Jarek Kowalski
You right.
The version of Nlog was the problem.
Although I install the new version (v2, ontop the old version v1), remove the dll and add it again (in VS2003: add=>new item=>nlog config file) the added dll was of the old version v1.
When I checked it i looked for the runtime version which is v2.0.50727 - that why i was confused.

BTW, why it did not add the new version using the addition of the wizard?
(in VS2003: add=>new item=>nlog config file)

Best