Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i read your article about multiple log4net outputs from one application (http://www.codeproject.com/KB/dotnet/MultipleLog4net.aspx).
I use this solution in my project, adding your log4net's configuration in my app.conf file.
But this not work.
I have a client ahd it use a my dll. I would two log output in different file , one from my dll and one my application client. I have a regular output from application (file appender) and a errorate output from my dll (RollingFileAppender) that create the rolling file but don't write the contents (in a xml soap request that i would to log rollingfile method) .
This is my app.conf

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<!--Configuration Rolling for soap message log from SoapLoggerDLL-->
<appender type="log4net.Appender.RollingFileAppender" name="SoapDLL">
<file value="log/WSREQUEST/SOAP_RQST_" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<datePattern value="yyyy-MM-dd-HH.mm.ss.x\ml" />
<Pattern value=".xml" />
<StaticLogFileName value="false"/>
<maxSizeRollBackups value="2" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message%newline" />
</layout>
</appender>

<!--Configuration File appender for clientws log -->
<appender type="log4net.Appender.FileAppender" name="application">
<file value="log/ClientTraceThemLOG.log" />
<param name="AppendToFile" value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionpattern value="%d %-5p %m%n" />
</layout>
</appender>

<logger name="Logging">
<level value="INFO" />
<maximumfilesize value="256KB" />
<param value="INFO" name="Threshold" />

<appender-ref ref="SoapDLL" />
</logger>

<logger name="ClientTraceThem">
<level value="DEBUG" />
<maximumfilesize value="256KB" />
<param value="DEBUG" name="Threshold" />

<appender-ref ref="application" />
</logger>



</log4net>

</configuration>
and this is the console error message:
log4net:ERROR XmlHierarchyConfiguration: Cannot find Property [maximumfilesize] to set object on [log4net.Repository.Hierarchy.DefaultLoggerFactory+LoggerImpl]
log4net:ERROR XmlHierarchyConfiguration: Cannot find Property [Threshold] to set
object on [log4net.Repository.Hierarchy.DefaultLoggerFactory+LoggerImpl]
log4net:ERROR XmlHierarchyConfiguration: Cannot find Property [Pattern] to set object on
[log4net.Appender.RollingFileAppender]
log4net:ERROR XmlHierarchyConfiguration: Cannot find Property [maximumfilesize] to set object on [log4net.Repository.Hierarchy.DefaultLoggerFactory+LoggerImpl]
log4net:ERROR XmlHierarchyConfiguration: Cannot find Property [Threshold] to set
object on [log4net.Repository.Hierarchy.DefaultLoggerFactory+LoggerImpl]

and, when a log from application is create , is created also a empty rolling file.
Thanks aticipatament for a your possible response.
Best Regards

p.s. excuse my english
Posted
Updated 22-Feb-11 14:01pm
v4

I can't find the Tag Root in you config file
 
Share this answer
 
In the example on http://www.codeproject.com/KB/dotnet/MultipleLog4net.aspx there is not a root tag, and the author specify that i need to remove this tag and to use logger tag.
Thanks aticipatament for a your possible response.
Best Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900