logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shekar <shivaraj...@gmail.com>
Subject Re: Frist time user needs advise
Date Sat, 13 Mar 2010 10:42:59 GMT
1. XXXX - Your class name, thats it.

2.  Even before the first step, load your config file like this!

Load the config file using XmlConfigurator.Configure(ConfigFileName).

Pls let me know if this doesn't helps. Happy coding:-)

Thanks,

On Thu, Mar 11, 2010 at 1:14 AM, Information Vision <info@infovis.co.uk>wrote:

>  Hi
>
>
>
> I have  a vb.net winform app that uses SUB Main in module modMain as
> start-up.
>
>
>
> I have copied log4net.dll and log4net.xml files to the application main
> folder. I have added log4net.dll to application references.
>
>
>
> I have added below configuration in file Logging.Xml and have placed it in
> the application main folder.
>
>
>
> Logging.Xml -- BEGIN
>
> <log4net>
>
>     <appender name="Console" type="log4net.Appender.ConsoleAppender">
>
>         <layout type="log4net.Layout.PatternLayout">
>
>             <!-- Pattern to output the caller's file name and line number
> -->
>
>             <conversionPattern value="%5level [%thread] (%file:%line) -
> %message%newline" />
>
>         </layout>
>
>     </appender>
>
>
>
>     <appender name="RollingFile"
> type="log4net.Appender.RollingFileAppender">
>
>         <file value="example.log" />
>
>         <appendToFile value="true" />
>
>         <maximumFileSize value="100KB" />
>
>         <maxSizeRollBackups value="2" />
>
>
>
>         <layout type="log4net.Layout.PatternLayout">
>
>             <conversionPattern value="%level %thread %logger -
> %message%newline" />
>
>         </layout>
>
>     </appender>
>
>
>
>     <root>
>
>         <level value="DEBUG" />
>
>         <appender-ref ref="Console" />
>
>         <appender-ref ref="RollingFile" />
>
>     </root>
>
> </log4net>
>
> Logging.Xml -- END
>
>
>
> My questions are;
>
>
>
> 1. In modMian I added the following line
>
>
>
> Private ReadOnly log As ILog = LogManager.GetLogger(GetType(xxxx))
>
>
>
> What do I enter in place of xxxx?
>
>
>
> 2. How do I tell my app to use Logging.Xml for configuration from the
> application main folder?
>
>
>
> Thanks
>
>
>
> Regards
>
>
>
>
>
> Yahya
>
>
>
>
>

Mime
View raw message