How to change the error.log directory?

Posted by Community Admin on 03-Aug-2018 17:14

How to change the error.log directory?

All Replies

Posted by Community Admin on 27-Jan-2011 00:00

Hello
How can I change the location for the error.log file. I'm trying to autodeploy with NAnt, but can't delete the error.log file in the target directory as it is in use by another process so I want to move it out of the project directory and into c:/logs where all my other log files go.

Thanks

Ryan

Posted by Community Admin on 27-Jan-2011 00:00

Hi Ryan,

You can use ObjectFactory class (represents a static factory class for creating application objects with IUnityContainer )

Inside Application_Start event of Global.asax you can registers types with IoC framework.

You can subscribe for ObjectFactory.Initializing and cancel the event if executing args. command name is  ConfigureLogging

ObjectFactory.Initializing += new EventHandler<Telerik.Sitefinity.Data.ExecutingEventArgs>(
 
delegate(object s, Telerik.Sitefinity.Data.ExecutingEventArgs args)
 
 
if (args.CommandName == "ConfigureLogging")
 
 
args.Cancel = true;
var errorFileName = HostingEnvironment.MapPath("mypath");
 
 
);
 



All the best,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 28-Jan-2011 00:00

Thanks Ivan - is there a particular namespace I need to import to get that code working?

Posted by Community Admin on 28-Jan-2011 00:00

Hi Ryan,

You should be add all need namespaces using Visual Studio Intellisense. Can you subscribe for Initializing event? We added it recently and I think that could be not included in your build, but it would be added for sure in the Friday's build.

All the best,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 28-Jan-2011 00:00

Yes, it's the Initializing event that isn't appearing in Intellisense. I'll check out the weekly build.

Thanks again
Ryan

Posted by Community Admin on 10-Feb-2011 00:00

Try

Telerik.Sitefinity.Abstractions.Bootstrapper.Initializing

Posted by Community Admin on 05-Sep-2011 00:00

Hi I also want to change the location of the error.log to a folder under C:\ . I use the following like you described,

ObjectFactory.Initializing += new EventHandler<Telerik.Sitefinity.Data.ExecutingEventArgs>(
 
delegate(object s, Telerik.Sitefinity.Data.ExecutingEventArgs args)
 
 
if (args.CommandName == "ConfigureLogging")
 
 
args.Cancel = true;
var errorFileName = HostingEnvironment.MapPath("mypath");
 
 
);
 

However, it is not working, If I want to move to folder "C:\SitefinityLog\" then I should use "var errorFileName = HostingEnvironment.MapPath(@"C:\SitefinityLog\")" ?

Posted by Community Admin on 07-Sep-2011 00:00

Hello Zarni,

Please take a look at this post

www.sitefinity.com/.../change-logging-directory.aspx

Best wishes,
Ivan Dimitrov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 08-Sep-2011 00:00

Hi Thanks a lot for your help. I followed the instructions from the link you provided and it is working now :)

This thread is closed