Re: New NLog snapshots published

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: New NLog snapshots published

Jarek Kowalski
Hi Narendra,

1. Make sure you have NLog.Win32.dll in the same directory where NLog.dll is
2. You should use ${asp-session:variable=VariableName} not ${asp-session}
(be aware that this is for classic ASP, not ASP.NET - if you want to use
this with ASP.NET change ${asp-session} to ${aspnet-session})
3. You could get somewhat nicer output if you used the new BufferingWrapper

Instead of:

    <target name="mail" type="Mail" ... attributes go here ... />


    <target name="mail" type="BufferingWrapper" buffersize="100">
        <target type="Mail" ... attributes go here ...  />

And you'd get all your log messages groupped and sent via email, each
message having 100 log entries.
NOTE: You don't need to define a name for the wrapped target.

Some nice layouts for the Mail target which you may use are:

header="This is header${newline}--------------------------${newline}"
footer="--------------------------${newline}This is footer${newline}"
body="${longdate} ${logger} ${message}${newline}"

Jaroslaw Kowalski
----- Original Message -----
From: Narendra Tiwari
To: Jaroslaw Kowalski
Sent: Friday, September 30, 2005 12:01 PM
Subject: Re: New NLog snapshots published

Thanks a lot for your cooperation J.K.,

I used your recently uploades build: 20050929

But could not read the aspnet-session layout renderer:-
Please suggest what is wrong in following Configuration.
I created an extra feld in described in config.


<nlog autoReload="true">
<target name="database" type="Database">
<dbprovider>mssql</ dbprovider>
<!-- database connection parameters -->
<!-- alternatively you could provide a single 'connectionstring'
parameter -->
<dbhost>; </dbhost>
<dbdatabase>NLogDatabase</ dbdatabase>
<dbusername>nloguser</ dbusername>
<dbpassword>nlogpassword</ dbpassword>
<!--<connectionString value="data source=;initial
catalog=NLogDatabase;integrated security=false;persist security
info=True;User ID=nloguser;Password=nlogpassword" />-- >
insert into LogTable(time_stamp,level,logger,message, aspnetsession)
values(@time_stamp, @level, @logger, @message, @aspnetsession);
<parameter name="@time_stamp" layout="${date}" />
<parameter name="@level" layout="${level}" />
<parameter name="@logger" layout="${logger}" />
<parameter name="@message" layout="${message}" />
<parameter name="@stacktrace" layout="${stacktrace}" />
<parameter name ="@aspnetsession" layout="${aspnet-session}" />
<target name="mail" type="Mail" smtpserver ="eblas15p2.ebookers" HTML="true"
from="[hidden email]" to=""
cc="[hidden email]" bcc =""
subject="SMTP-Target: NLog" header ="This is Header" body="${message}"
footer="This is Footer"
<logger name="*" minlevel="Error" appendTo ="database" />
<logger name="*" minlevel="Debug" appendTo ="mail" />

On 9/29/05, Jaroslaw Kowalski <[hidden email]> wrote:

I've uploaded the new set of NLog snapshots (20050929). It's available at:

There are two BREAKING changes:

* NLog.Target.Append() has been renamed to Write() and there's another
overload which takes LogEventInfo[] .
* To properly support target wrappers, you need to enlist all Layouts that
your target uses by overriding Target.PopulateLayouts(). If you don't do it,
your targets may not work properly when used with wrapper targets and/or
compound targets.

The list of the most important changes since 0.9 release:

* Added Mail target which uses System.Web.Mail for SMTP
* Added batch NLogC compilation, added installer and nlogc binary
* Refactored NLogViewer by separating NLogViewer.Interfaces
* Added NLogViewer.NDumbsterSmtpReceiver (by Ron Grabowski)
* Added support for caching layout results per logEvent which
makes them transportable across threads
* Added Log4JXmlEvent ${log4jxmlevent}
* Added Wrappers: AsyncWrapper, AutoFlushWrapper, BufferingWrapper,
RepeatingWrapper, RetryingWrapper
* Some preliminary work on request buffering wrappers.
* Added compound targets (fallback, randomize, roundrobin, split)
* added a new Trace level, more verbose than the Debug
* fixed VS.NET Compact Framework project file
* added support for <variable name="" value="" /> configuration element
* added experimental PerformanceCounter layout renderer.
* fixed the Trace target in Release mode by defining TRACE symbol
* refactored NLogViewer to use log4j schema instead of inventing my own
* added StackTrace layout renderer, 3 different logging formats
* added NewLine layout renderer
* fixed CompactFramework build
* fixed NLogC compilation
* fixed the filter configuration bug as reported by Ron Grabowski
* fixes for case-insensitive parsing of the config files.
* added unit tests that verify case-insensitivity.
* added many more unit tests (we have now over 70% coverage)
* fixed bugs related to ${asp-request:cookie} and ${aspnet-request:cookie}
and many other small bugs
* added some minimal VB.NET test code
* added some meaningful error message when a named target is not defined.

Everyone is encouraged to download and test this unofficial release since
this will be the base of the upcoming 0.95 release. Please report any bugs
to the mailing list.

I'll be explaining the new features in subsequent emails.
Jaroslaw Kowalski 

This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more.
Nlog-list mailing list
[hidden email]
NLog Blog