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

Is there an element for setting up margins for a logging file in the app.config?
Is there also a way for putting the datestamp before the ".txt" extension because now it's looks like: InfoDebug_Logging_TestSimulator.txt.2011-05-20

I want it like this:
InfoDebug_Logging_TestSimulator_2011-05-20.txt
XML
<appender name="RollingFileAppender1" type="log4net.Appender.RollingFileAppender">
    <file value="Logging\InfoDebug_Logging_TestSimulator.txt" />
    <appendToFile value="true" />
    <!--<rollingStyle value="Size" />
    <maxSizeRollBackups value="10" />
    <maximumFileSize value="10000" />
    <staticLogFileName value="true" />-->
    <!-- Alternatively, roll on date -->
    <rollingStyle value="Date" />
    <param name="DatePattern1" value=".yyyy-MM-dd-HH.\t\x\t" />
    <maxSizeRollBackups value="20" />
    <maximumFileSize value="15MB" />
    <filter type="log4net.Filter.LevelRangeFilter">
    <acceptOnMatch value="true" />
    <levelMin value="DEBUG" />
    <levelMax value="FATAL" />
    </filter>
    <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date{HH:mm:ss.fff} %-5level %-32logger %-30M %message%newline" />
    </layout>
  </appender>
Posted
Updated 21-May-11 6:35am
v2
Comments
Christian Graus 21-May-11 12:38pm    
Looks like your question is about a specific library, certainly not about XML or XSLT..

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