How to get the old system log?

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
2/16/2011 10:55:32 PM
Koe
Gravatar
Total Posts 29

How to get the old system log?

I want to download the system log for a month, but I find that the system has overwrite the older that I cannot download all of the logs.

I haven't clear the log, so is it somewhere that I can find the full copy of log?

Thanks.

2/17/2011 10:11:03 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: How to get the old system log?

Hi there. The current log is in /Data/currentlog.config. Previous logs are saved in curretlog.config.1, currentlog.config.2, ...

Keep in mind that the logs are not kept forever. The log settings are stored in /log4net.config. The default settings for log file size and number of backups are:

    <maxSizeRollBackups value="3" />
    <maximumFileSize value="800KB" />

If you have a lot of activity in your log files, you may also want to change the following setting to "WARN" or "ERROR" to reduce the number of events being logged:

    <level value="INFO" />

If you make changes to this file, you'll want to touch web.config in order for the site to pick up the new settings.

Hope that helps.

Jamie

2/17/2011 10:13:33 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: How to get the old system log?

This question also reminded me that I want to ask Joe something: Can support be added to specify our own custom log4net.config file, so we don't have to worry about it getting overwritten during each upgrade? I'm thinking of a setting that would work like the existing:

    <add key="mojoProfileConfigFileName" value="mojoProfile.config" />

Thanks,

Jamie

2/17/2011 10:32:29 AM
Gravatar
Total Posts 18439

Re: How to get the old system log?

Hi Jamie,

I don't think so. It is compiled in from global.asax.cs like this:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]

and I don't think we can use any web.config setting there.

So if people customize it they will have to restore their customizations after upgrades.

Best,

Joe

2/20/2011 10:52:20 PM
Koe
Gravatar
Total Posts 29

Re: How to get the old system log?

Thank you. I can find all the files, but I still have some questions about that.

1. Did the system log display only the data in currentlog.config (not currentlog.conifg.1) even if currentlog.config have a small size?

2. If I click "clear log", would all files be deleted? (Including currentlog.config, config.1, config.2, etc)

 

 

2/21/2011 10:37:48 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: How to get the old system log?

I believe that mojoPortal's System Log is only looking at and operating on the entries in currentlog.config, so the display and clearing of it will only affect that file. I can't currently test, though, so be sure to back those files up and test it before you rely on this.

By the way, I also created a new document about the mojoPortal System Log with the information I've posted here.

Jamie

2/21/2011 11:38:03 AM
Gravatar
Total Posts 18439

Re: How to get the old system log?

The web page log viewer only interacts with the currentlog.config file. If you clear the log it only clears the currentlog.config file. If you want to read the older logs you need to download them by ftp. The logs are rolling so when currentlog.config gets to the size setting it rolls the old files forward, ie 2 becomes 3 (3 is deleted), 1 becomes 2, and the current log becomes 1.

The only way to view the older log files is to download them by ftp.

Actually after reviewing this, I'm going to change the maxSizeRollBackups from 3 to 1 so that it does not keep the older ones by default. My reason is because I do not like the way the RollingLogFileAppender names the older files. The .config extension is protected by default so no-one can get the file with an http request like http://siteroot/Data/currentlog.config. But the way it names the older ones with .1, .2, .3 as the file extension seems risky that someone could download the older log files (though on my server it does not serve the old log files in theory it might on some servers).

Best,

Joe

2/22/2011 10:18:27 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: How to get the old system log?

Thanks for that update, Joe. It's a shame there's no way to specify archive file names like "currentlog_1.config".

So, to keep the same amount of overall logging space, the maximumFileSize setting would need to be 3200KB. Do you think it would be safe to increase this to a 5MB default while you're making the changes?

Thanks,

Jamie

2/23/2011 12:20:29 PM
Gravatar
Total Posts 18439

Re: How to get the old system log?

Hi Jamie,

Sorry but that is too big to load in a web page in my opinion. The size 800kb seemed like a reasonable size given that we load it in the UI.

Note that at some point I will be implementing a way to log into the database rather than a text file and that may give more flexibility in terms of how much we keep and for how long and it would be pageable from the UI.

Best,

Joe

2/23/2011 1:00:15 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: How to get the old system log?

Okay, thanks Joe, that makes sense. I checked our site, and we aren't serving the log backup files either, so I think I'm going to keep using them via customization of log4net.config. The main issue I see with not having any rolling backups is that the log file is truncated each time it fills up, so without those rolling files a lot can get lost, and I'd hate to need to see the events and not have them. At the INFO logging level, we're currently filling up an 800 KB log in about a day.

I'll look forward to the in-database logging. That definitely seems like the ultimate solution, and it will be nice to be able to run queries against the database for the different events.

Jamie

You must sign in to post in the forums. This thread is closed to new posts.