[ 
https://issues.apache.org/jira/browse/LOG4NET-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13737969#comment-13737969
 ] 

Baha commented on LOG4NET-387:
------------------------------

- I'm using RollingLogFileAppender (please see the config below)
- I'm writing text strings (not binary)

        //Write error message
        public static void WriteError(string message, params object[] args)
        {
            //get logger object
            ILogger log = GetLogger();

            //write error message
            if (log.IsEnabledFor(Level.Error))
            {
                message = string.Format(message, args);

                log.Log(typeof(Logger), Level.Error, message, null);
            }
        }


  <log4net debug="true">
    <appender name="RollingLogFileAppender" 
type="log4net.Appender.RollingFileAppender">
      <file value="Log.txt" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="2" />
      <maximumFileSize value="1MB" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="[%-5level] %date %type{1}.%method - 
%message%newline" />
      </layout>
    </appender>
    <root>
      <level value="All" />
      <appender-ref ref="RollingLogFileAppender" />
    </root>
  </log4net>
                
> Mysterious characters in the log file
> -------------------------------------
>
>                 Key: LOG4NET-387
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-387
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.10
>         Environment: Windows XP, .Net 2.0 Framework, Windows Service 
> Application
>            Reporter: Baha
>            Priority: Blocker
>              Labels: bug
>             Fix For: 1.2.10
>
>
> We have a windows service application in production. This windows service is 
> logging greatly with no issues, but sometimes it starts logging mysterious 
> characters like in this screenshot:
> https://files.secureserver.net/0sq7H3khXnoq67
> To fix this, we clean the log file, and restart the windows service again, 
> but in this way, we are loosing most of the logs (specially the 
> exception/error fired by the windows service).
> Any idea on this will be greatly appreciated.
> Baha Ashour,
> RFID Enabled Solutions
> b...@resrfid.com 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to