You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "jayluc2 (via GitHub)" <gi...@apache.org> on 2024/09/26 20:55:00 UTC
[I] Logging is not generated after upgrading to 3.0 (logging-log4net)
jayluc2 opened a new issue, #191:
URL: https://github.com/apache/logging-log4net/issues/191
After updating from version 2.0.15 to 3.0.0, our logging isn't being written. I've managed to isolate this to using GlobalContext properties within the file name, although I suspect anywhere properties are used are also a problem. I've boiled our code down to the minimal set needed to reproduce the issue:
Program.cs:
static void Main(string[] args)
{
log4net.GlobalContext.Properties["mycustomusername"] = "me";
Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
FileInfo logfile = new FileInfo(configuration.FilePath);
XmlConfigurator.ConfigureAndWatch(logfile);
var _log = log4net.LogManager.GetLogger(typeof(Program));
long value = 0;
while (true)
{
_log.Debug($"New value is: {value++}");
Thread.Sleep(1000);
}
}
App.Config:
<log4net>
<appender name="RollingAppender" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="f:\temp\%property{mycustomusername}TestAppLog.log"/>
<appendToFile value="true"/>
<preserveLogFileNameExtension value="true"/>
<rollingStyle value="Composite"/>
<datePattern value=".yyyyMMdd"/>
<maximumFileSize value="1KB"/>
<countDirection value="1"/>
<maxSizeRollBackups value="20"/>
<staticLogFileName value="false"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level [%thread] - %message%newline"/>
</layout>
</appender>
<root>
<level value="DEBUG"/>
<appender-ref ref="RollingAppender"/>
</root>
</log4net>
This message appears in the console window:
log4net:WARN Unable to set property [file] on object [log4net.Appender.RollingFileAppender] using value [f:\temp\%property{mycustomusername}TestAppLog.log] (with acceptable conversion types)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Logging is not generated after upgrading to 3.0 (duplicate of #183) (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil closed issue #191: Logging is not generated after upgrading to 3.0 (duplicate of #183)
URL: https://github.com/apache/logging-log4net/issues/191
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Logging is not generated after upgrading to 3.0 (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil commented on issue #191:
URL: https://github.com/apache/logging-log4net/issues/191#issuecomment-2377944754
Hi @jayluc2,
thanks for reporting.
This bug was fixed in https://www.nuget.org/packages/log4net/3.0.1-preview.2
We will release the final 3.0.1 tomorrow.
Duplicate of #183
Related to #184, #185, #186, #187, #188
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org