Friday, May 18, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: testing log4net
Prev Next
You are not authorized to post a reply.

Author Messages
Yann Luppo

06/18/2008 9:44 PM  

Hi everyone,

 

I’m currently testing log4net and I can’t seem to be able to make the remoting part work properly. I am using the example remoting server app that’s provided with the log4net download and I implemented the remoting client part, mostly extracted from the remoting client example, in our project. All that running locally.

 

Our project is an ASP.Net web application and the part that needs to use log4net is one of our custom dlls for that application. For the sake of readability let’s call it the utility.dll. So I added an app.config to the utility.dll where I copied all the xml from the config file provided with the remoting client example app. Since my asp.net project runs locally, I just wanted to hit the remoting server running locally also.

I did a couple changes to the remoting server config file actually, but mostly to reformat the messages.

 

To make sure I wasn’t waiting for buffered logs on the client side I changed the “BufferSize” variable to 1. Here is an extract of my client side config file:

 

<log4net debug="false">

            <!-- Define some output appenders -->

            <!-- Use the remoting appender -->

            <appender name="RemotingAppender" type="log4net.Appender.RemotingAppender" >

                  <!-- The remoting URL to the remoting server object -->

                  <sink value="tcp://localhost:8085/LoggingSink" />

                  <!-- Send all events, do not discard events when the buffer is full -->

                  <lossy value="false" />

                  <!-- The number of events to buffer before sending -->

                  <bufferSize value="1" />

                  <!-- Do not store event data that is slow to generate -->

                  <onlyFixPartialEventData value="true" />

                  <!-- Specify an evaluator to send the events immediatly under

                       certain conditions, e.g. when an error event ocurrs -->

                 

                  <evaluator type="log4net.Core.LevelEvaluator">

                        <threshold value="INFO"/>

                  </evaluator>

                 

            </appender>

            <!-- Setup the root category, add the appenders and set the default priority -->

            <root>

                  <level value="DEBUG" />

                  <appender-ref ref="RemotingAppender" />

            </root>

      </log4net>

 

Anyway as you can imagine the reason for my email is that the logs aren’t making it to the server side… Even though they do when I just use the remoting client example application.

 

Any idea on why this is not happening?

 

Thanks,

Yann

Yann Luppo

06/18/2008 11:54 PM  

Figured it out. Thanks Google!

The web.config should contain this new line in ConfigSections:

 

<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net-net-1.2"/>

 

And then the config section below can be added in the web.config… Everything works fine now. J

 

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > testing log4net



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement