Minutes have freezed in logger

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Minutes have freezed in logger

Shurhen
Hi NLOG developers! I've faced with such problem (part of my nlog-created file):
14:11:58 ....
14:11:58 ....
15:11:00  ....
15:11:00  ....
15:11:02  ....
I.e. the hours and seconds are ok, but minutes hadn't been changed.
Help me, pls, if you can.

WBR, Shurhen

Sorry, I've forgotten about code ^)

            var fileTarget = new FileTarget
            {
                FileName = "${basedir}/ObjectCreator.log",
                Layout = "${date:format=HH\\:MM\\:ss} ${message}"
            };
            // Create configuration object
            var config = new LoggingConfiguration();
            // Set target properties
            config.AddTarget("file", fileTarget);
            var a_Rule = new LoggingRule("*", LogLevel.Debug, fileTarget);
            config.LoggingRules.Add(a_Rule);
            // Activate the configuration
            LogManager.Configuration = config;
            m_Logger = LogManager.GetLogger("ThreadInfo");

 m_Logger.Info("....");
Reply | Threaded
Open this post in threaded view
|

Re: Minutes have freezed in logger

Shurhen
This problem has been solved :)
Instead
Layout = "${date:format=HH\\:MM\\:ss} ${message}"
need
Layout = "${date:format=HH\\:mm\\:ss} ${message}"
I.e. minutes should be set in lowercase format, uppercase  is a month