<log4net>
  
  <root>
    <level value="INFO" />
    <!--<appender-ref ref="console" />-->
    <!--<appender-ref ref="database" />-->
  </root>

  <logger name="DEFAULT">
    <level value="INFO"/>
    <appender-ref ref="DefaultRolling"/>
  </logger>

  <logger name="TibSimulator">
    <level value="DEBUG"/>
    <appender-ref ref="TibSimulator"/>
    <appender-ref ref="DefaultConsle"/>
  </logger>

  <logger name="TibRendzvous">
    <level value="DEBUG"/>
    <appender-ref ref="TibRendzvous"/>
    <appender-ref ref="DefaultConsle"/>
  </logger>

  <appender name="DefaultConsle" type="log4net.Appender.ConsoleAppender">
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="[%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}] %level %logger %X{id} : %X{class}.%X{method}() %message%newline" />
    </layout>
  </appender>

  <appender name="DefaultRolling" type="log4net.Appender.RollingFileAppender">
    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
    <file type="log4net.Util.PatternString" value="%envFolderPath{MyDocuments}\DDUtility\Logs\" />
    <!--<file type="log4net.Util.PatternString" value="X:\EIS서버\DDUtility\Logs\" />-->
    <datePattern value="yyyyMMdd'.log'" />
    <maxSizeRollBackups value="50" />
    <maximumFileSize value="10MB" />
    <staticLogFileName value="false" />
    <appendToFile value="true" />
    <preserveLogFileNameExtension value="true"/>
    <rollingStyle value="Composite" />
    <countDirection value="0" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="[%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}] %level %logger %X{id} : %X{class}.%X{method}() %message%newline" />
    </layout>
  </appender>

  <appender name="TibSimulator" type="log4net.Appender.RollingFileAppender">
    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
    <file type="log4net.Util.PatternString" value="%envFolderPath{MyDocuments}\DDUtility\Logs\TibSimulator_" />
    <datePattern value="yyyyMMdd'.log'" />
    <maxSizeRollBackups value="100" />
    <maximumFileSize value="10MB" />
    <staticLogFileName value="false" />
    <appendToFile value="true" />
    <preserveLogFileNameExtension value="true"/>
    <rollingStyle value="Composite" />
    <countDirection value="0" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="[%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}] %level %logger %X{id} : %X{class}.%X{method}() %message%newline" />
    </layout>
  </appender>

  <appender name="TibRendzvous" type="log4net.Appender.RollingFileAppender">
    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
    <file type="log4net.Util.PatternString" value="%envFolderPath{MyDocuments}\DDUtility\Logs\TibEvent_" />
    <datePattern value="yyyyMMdd'.log'" />
    <maxSizeRollBackups value="50" />
    <maximumFileSize value="10MB" />
    <staticLogFileName value="false" />
    <appendToFile value="true" />
    <preserveLogFileNameExtension value="true"/>
    <rollingStyle value="Composite" />
    <countDirection value="0" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="[%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff} %level] %logger %X{id} : %X{class}.%X{method}() %message%newline" />
    </layout>
  </appender>

  <appender name="DefaultDatabase" type="log4net.Appender.AdoNetAppender">
    <bufferSize value="1" />
    <ReconnectOnError value="true" />
    <connectionType value="MySql.Data.MySqlClient.MySqlConnection, MySql.Data" />
    <connectionString value="datasource=127.0.0.1;port=3306;database=logdb;user=logger;password=1234!@#$;" />
    <commandType value="StoredProcedure"/>
    <commandText value="SP_InsertLog" />
    <parameter>
      <parameterName value="LogDate" />
      <dbType value="String" />
      <size value="30" />
      <layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}" />
    </parameter>
    <parameter>
      <parameterName value="LogSystem" />
      <dbType value="String" />
      <size value="20" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%X{system}" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="LogName" />
      <dbType value="String" />
      <size value="30" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%c" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="LogID" />
      <dbType value="String" />
      <size value="30" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%X{id}" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="LogLevel" />
      <dbType value="String" />
      <size value="10" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%p" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="LogClass" />
      <dbType value="String" />
      <size value="100" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%X{class}" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="LogMethod" />
      <dbType value="String" />
      <size value="50" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%X{method}" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="LogMessage" />
      <dbType value="String" />
      <size value="65000" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%m" />
      </layout>
    </parameter>
    <parameter>
      <parameterName value="LogException" />
      <dbType value="String" />
      <size value="65000" />
      <layout type="log4net.Layout.ExceptionLayout" />
    </parameter>
  </appender>
  
</log4net>