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: Partial configuration of an AdoNetAppender in the config File
Prev Next
You are not authorized to post a reply.

Author Messages
Bernhard Heinzel

10/23/2008 7:55 AM  
Good Morning,

Is it possible to partially configure an AdoNetAppender with an config File and later pass him in the source code the connetion string and type?

So I try to use the sample config below to to configur with XMLConfiguration and then pass the connetion string and type but I don't get it to work?

Any Suggestions?

Thanks in advance.

Regards
Bernhard

Sample Config.
</log4net>
    <appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
        <bufferSize value="10" />   
        <commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Username],[Host],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @username, @host, @message, @exception)" />
        <parameter>
            <parameterName value="@log_date" />
            <dbType value="DateTime" />
            <layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}" />
        </parameter>

        <parameter>
            <parameterName value="@thread" />
            <dbType value="String" />
            <size value="255" />
            <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%thread" />
            </layout>
        </parameter>

    ...
    </appender>

    <logger name="DEBUG2">
        <level value="ALL" />
        <appender-ref ref="AdoNetAppender" />
    </logger>

</log4net>


Discover the new Windows Vista Learn more!
Bernhard Heinzel

10/23/2008 11:21 AM  
Not longer needed, found a work around.

Bernhard

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > Partial configuration of an AdoNetAppender in the config File



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