I am not able to access environment variables in C# console application's app.config file.
I want to access log-level's value from ENVIRONMENT Variable LOG_LEVEL
in app.config :
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a" />
</configSections>
<log4net>
<root>
<level value="INFO"/>
<appender-ref ref="RollingFileAppender" />
<appender-ref ref="ConsoleAppender" />
</root>
<!--log to console-->
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level %logger - %message%newline" />
</layout>
</appender>
</log4net>
</configuration>
I want to access it like <level value=%LOG_LEVEL%>
.
But I am not able to access it on OSX.
I have tried using it like $LOG_LEVEL
, ${LOG_LEVEL}
, %LOG_LEVEL