0

I have obfuscated my application using .net reactor. Application is working fine other then on some places method names in log file created through log4net is coming as random string. Strange thing is within same method different logs are coming with different behavior. Some coming with actual method name while other with random method name. e.g,

My log4net appender is

<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender" >
    <file value="..\\Logs\\MyApp_N1" />
    <encoding value="utf-8" />
    <appendToFile value="true" />
    <datePattern value="_yyyyMMdd'.log'" />
    <staticLogFileName value="false" />
    <rollingStyle value="Composite"/>
    <maxSizeRollBackups value="-1"/>
    <maximumFileSize value="10MB"/>
    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
    <filter type="log4net.Filter.LevelRangeFilter">
      <acceptOnMatch value="true" />
      <levelMin value="DEBUG" />
      <levelMax value="FATAL" />
    </filter>
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%d{yyyy-MM-dd HH:mm:ss.fff}&#9;%p&#9;MyApp&#9;N1&#9;%t&#9;%c{1}.%M&#9;%property{SessionId}&#9;%m%n" />
    </layout>
  </appender>

log4net version 2.0.8 .net reactor version 5.0

Sample Log Messages are

2017-12-08 15:17:33.722 DEBUG TWS N1 13 MyclassName.SendMessage My method start

2017-12-08 15:17:33.840 DEBUG TWS N1 13 MyclassName.urT1VHsGarQ1gTcc8O Message request add in db id =166364

2017-12-08 15:17:33.852 DEBUG TWS N1 13 MyclassName.SendMessage Message Services - Send End

Kamran Shahid
  • 3,954
  • 5
  • 48
  • 93

1 Answers1

0

If the method 'urT1VHsGarQ1gTcc8O' is not a public one then this is the expected output.

To obfuscate all public classes and methods as well you need to set "2. Protection Settings"->"Obfuscation"->"Obfuscate Public Types" to "True".

Eziriz
  • 331
  • 2
  • 5