Username with nlog

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Username with nlog

Micha
I use nlog to log informations in my application.


What do I have to do to display the username? He is always empty!
Reply | Threaded
Open this post in threaded view
|

Re: Username with nlog

Philipp Lauchner
Administrator
Dear Micha,

I assume you are using a pattern based logfile and no xml formatted logfile?
If so, can you actually see the username beeing present when you open the file with a simple text editor?

Are you using the same pattern to read the logfile in Log4View as has been used to generate the file? You can find the pattern used to generate the file in your logging applications' NLog settings in the layout  property of your target configuration.

If this still does not work, could you please send us a snippet of your logfile and the pattern you use to support@prosa.biz?

Yours sincerely

Philipp Lauchner
PROSA GmbH  
Development & Support
Reply | Threaded
Open this post in threaded view
|

Re: Username with nlog

Micha
NO, it is a network target!
Sorry for the initial description that was not detailed enough

I use this Target for logging with nlog over the network:

      <target name="network" xsi:type="Network" address="udp://127.0.0.1:879" newLine="false" maxMessageSize="65000" encoding="utf-8" layout="${log4jxmlevent:includeSourceInfo=true:includeCallSite=true:includeMdc=true:appInfo=LogEmiter:includeNdc=true:includeNLogData=true}"/>

With this target, the user name is not displayed in Log4View.
Reply | Threaded
Open this post in threaded view
|

Re: Username with nlog

Philipp Lauchner
Administrator
Dear Micha,

when you change target type to File with the same layout and open the file in an editor, you can see that there is simply no username present in the messages. That's why the username can not be displayed in Log4View.

It seems like NLog does not support logging the username when using the log4jxmlevent format. Yet solution aproaches are discussed here.

Yours sincerely

Philipp Lauchner
PROSA GmbH  
Development & Support