logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alasdair Richardson" <alasdair.richard...@jabcap.com>
Subject Using environment variables in the config
Date Mon, 07 Sep 2009 07:52:55 GMT
Hi
I am new to log4net (have used log4j etc). I wanted to set my config
using environment variables, and have been having mixed success.
 
  <!-- file is set to be a FileAppender -->
  <appender name="file" type="log4net.Appender.FileAppender">
    <file value="${JCE_LOG_FILE}"/>
    <appendToFile value="false"/>
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date{ISO8601} [%thread] %-5level
%logger - %message%newline" />
    </layout>
  </appender>

This works fine (the log file is set up to be a combination of appname,
user, date etc)
 
  <!-- Set root logger -->
  <root>
    <level value="${JCE_LOG_LEVEL}" />
    <!--level value="INFO" /-->
    <appender-ref ref="console" />
    <appender-ref ref="file" />
 
  </root>

This doesn't - ie env var substitution does NOT seem to be used on the
'level' tag?
 
Alasdair
____________________________________
The information contained in this transmission is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please notify the sender
immediately and delete this e-mail. Any unauthorised copying, disclosure or distribution of
the material in this e-mail is strictly forbidden.

Mime
View raw message