NLog Capabilities

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NLog Capabilities

vishwask
I am planning on using the NLog. Could somebody please let me know if the following is possible with NLog.

1.The logging is sent by MSMQ from multiple remote clients into a collector.
2. The logging is done asyncronously so that it either spawns a new thread or sends it immediately without blocking my current core thread.
3.The collector inserts into a SQL database using a sproc(optimized query).
4. The database schema is customizable to accomodate new fields.
5. Some kind of reporting alerting on a threshold of exception.

Thanks in advance for the help, any input will be greatly appreciated.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NLog Capabilities

Jarek Kowalski
Administrator
> 1.The logging is sent by MSMQ from multiple remote clients into a collector.
1. You can send logs using MSMQ, but there is no off-the-shelf
collector, so you have to write one. There is a sender/receiver pair
that uses WCF, which may work for you.

> 2. The logging is done asyncronously so that it either spawns a new thread
> or sends it immediately without blocking my current core thread.
2. Supported via AsyncTargetWrapper

> 3.The collector inserts into a SQL database using a sproc(optimized query).
3. Supported, just use EXEC sprocName as your SQL statement.

> 4. The database schema is customizable to accomodate new fields.
4. Supported. You can fully control the statement used to write logs
to a DB. NLog does not prescribe any particular schema.

> 5. Some kind of reporting alerting on a threshold of exception.
5. Not sure what you mean by that, but you can (for example) send
yourself an email when write to DB fails, or have the messages log to
a file in such situation. There is no support for threshold monitoring
(to get notified when DB gets too big, etc), but you can probably
integrate this outside of NLog.

Jarek
NLog Blog
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NLog Capabilities

vishwask
Thanks Jarek for your quick reply. I have further clarifications

The sender\receiver pair using WCF- Does the receiver have inbuilt function to login into a Database or that needs to be written ? The WCF can support any protocol like MSMQ?

The AsyncTargetWrapper will it work for the WCF sender\receiver ?

While using MSMQ NLog just sends a message to a remote queue and that's it ?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NLog Capabilities

Jarek Kowalski
Administrator
The sender\receiver pair using WCF- Does the receiver have inbuilt function to login into a Database or that needs to be written ? The WCF can support any protocol like MSMQ?

The receiver is a WCF service that collects logs from remote instances of NLog and forwards them to local NLog routing table, so yes - you can configure it to log to a DB without writing any extra code.
The receiver is available as a WCF service class - you need to host it in your environment, for example in a console app as shown here. You can also host it in IIS if you prefer.


The source code of the receiver itself is here:



The AsyncTargetWrapper will it work for the WCF sender\receiver ?

Yes.

While using MSMQ NLog just sends a message to a remote queue and that's it ? 

Correct. MSMQ is more of a low-level mechanism than a fully functional logging tool. Users are expected to integrate with it by writing a receiver of their own.

Jarek
NLog Blog
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NLog Capabilities

vishwask
WCF supports the MSMQ binding so can't the sender receiver be configured using it ?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NLog Capabilities

vishwask
Jarek,

I am also trying to compare Enterprise Library Logging Blocks with NLog and notice that EL appears to be bloated over proportion. Do you have some kind of comparison between the two that I could present to my group ?
Loading...