Wiki Navigation
- Loading...
Overview
MediaPortal 1.4.0 now uses log4net for logging.
The new log4net logging has elements that can be configured, specifically the log file size and log rotation. The default values are 1 MB log files, and 5 logs are retained.
- We now have the same logging format in all parts of MediaPortal
- The TVplugin is now logging into MediaPortal.log and no longer in TV.log
- Log files is now named after the running program (MediaPortal.exe -> MediaPortal.log)
- The Error.log is now renamed to MediaPortal-Error.log
Configuration
To configure the log4net settings, open the following file with a text editor: C:\ProgramData\Team MediaPortal\MediaPortal\log4net.config
It is possible to configure the maximum log file size and amount by altering the maximumFileSize and maxSizeRollBackups values in the DefaultLogAppender and ErrorLogAppender sections.
Example log4net.config
<appender name="DefaultLogAppender" type="log4net.Appender.RollingFileAppender">
<file value="[Name].log" />
<appendToFile value="true" />
<rollingStyle value="Once" />
<maxSizeRollBackups value="5" />
<maximumFileSize value="1MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date] [%-7logger] [%-9thread] [%-5level] - %message%newline" />
</layout>
</appender>
<appender name="ErrorLogAppender" type="log4net.Appender.RollingFileAppender">
<file value="[Name]-Error.log" />
<appendToFile value="true" />
<rollingStyle value="Once" />
<maxSizeRollBackups value="5" />
<maximumFileSize value="1MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date] [%-7logger] [%-9thread] [%-5level] - %message%newline" />
</layout>
</appender>
Technology
log4net is designed with two distinct goals in mind: speed and flexibility. The log4net package is designed so that log statements can remain in shipped code without incurring a high performance cost.
log4net can monitor its configuration file for changes and dynamically apply changes made by the configurator.
Background and History
The log4net project was started by Neoworks Limited in June 2001. It was created as an internal project within Neoworks to port the Apache log4j™ code base to the Microsoft® .NET Framework. The code base was initially branched from a pre-alpha log4j 1.2.
In July 2001 a Sourceforge project was started and log4net was published under the Apache Software License.
In December 2003 the Apache Logging Services project was created. In February 2004 log4net was donated by Neoworks to the Apache Software Foundation to become a member of the Logging Services project.
In February 2007 log4net graduated from the Apache Incubator project to become a fully fledged Apache project. Apache log4net is a subproject of the Logging Services project.
Additional Information and References
Mantis Issue #: |
|
|---|---|
Mantis Category: |
General |
Type of Change: |
Rework |
Related Wiki page(s): |
|
Author: |
Bavarian |
Date added: |
Sun, 31 Mar 2013 |
Related

This page has no comments.