Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hii,
I'm trying to log my controller's steps with LogHepler.
LogHelper.Info(GetType(), "Configuration started");
When I call this controller, run all code correctly, but strangely not write my custom logs to App_Data/Logs/UmbracoTraceLog.xx.txt log file.
(Note: I'm in Debug solution mode with Visual Studio)
-thanks
Hi Zihadul,
Are there any configuration changes to ~/config/log4net.config which might instruct the logs to persist elsewhere ? (assuming your web.config appSetting "log4net.Config" points to this file)
Hi Hendry,
my log4net.config file has this:
<?xml version="1.0"?> <log4net> <root> <priority value="Info"/> <appender-ref ref="AsynchronousLog4NetAppender" /> </root> <appender name="rollingFile" type="log4net.Appender.RollingFileAppender"> <file type="log4net.Util.PatternString" value="App_Data\Logs\UmbracoTraceLog.%property{log4net:HostName}.txt" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <maximumFileSize value="5MB" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value=" %date [P%property{processId}/D%property{appDomainId}/T%thread] %-5level %logger - %message%newline" /> </layout> <encoding value="utf-8" /> </appender> <appender name="AsynchronousLog4NetAppender" type="Log4Net.Async.ParallelForwardingAppender,Log4Net.Async"> <appender-ref ref="rollingFile" /> </appender> <!--Here you can change the way logging works for certain namespaces --> <logger name="NHibernate"> <level value="WARN" /> </logger> </log4net>
Then, Umbraco's default logs are writing correctly, only my custom logs are missing.
That looks like the default Umbraco configuration and should log Info level events, so I'm not sure what to suggest :(
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
LogHelper not writing
Hii,
I'm trying to log my controller's steps with LogHepler.
When I call this controller, run all code correctly, but strangely not write my custom logs to App_Data/Logs/UmbracoTraceLog.xx.txt log file.
(Note: I'm in Debug solution mode with Visual Studio)
-thanks
Hi Zihadul,
Are there any configuration changes to ~/config/log4net.config which might instruct the logs to persist elsewhere ? (assuming your web.config appSetting "log4net.Config" points to this file)
Hi Hendry,
my log4net.config file has this:
Then, Umbraco's default logs are writing correctly, only my custom logs are missing.
That looks like the default Umbraco configuration and should log Info level events, so I'm not sure what to suggest :(
is working on a reply...