Moved on log5f.org
June 14, 2011 Leave a Comment
Please, visit the new home page – log5F.org
Please, visit the new Log5F's home page – http://log5f.org
July 13, 2010 7 Comments
From beginning Log5F uses predefined external XML files for configuration. But from version 1.0 Log5F can be configured from custom external XML files or from XML objects.
Log5F tries to load configuration from these predefined URLs `{bin-dir}/log5f.xml` *or* `{bin-dir}/log5f.properties`. So if Log5F can load `log5f.xml` it can’t try to load `log5f.configuration`, but it try to load `log5f.configuration` if loading `log5f.xml` is fail.
Log5F allows to customize configuration through the `Log5FConfigurator` class, that provides API for add URLs of custom configuration files.
Log5FConfigurator has next `static` fields:
A flag that indicates if Log5F is configured and ready to use.
A flag that indicates if Log5F throw an error messages to trace.
Allows to add url of an external configuration file, whereupon it will be loaded before loading of the predefined files.
Also it method configures Log5F from the specified in `source` data, if it isn’t a string.
Parameters:
Example:
Log5FConfigurator.configure("configuration.xml");
Note: If source is not string configuration starts immediately, otherwise configuration starts only when Log5F is really used.
From version 1.0 is possibility to configure Log5F from XML, just pass to Log5FConfigurator.configure method XML in first parameter:
var config:XML =
<configuration xsi:noNamespaceSchemaLocation="log5f.properties.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:log5j="http://log5f.org">
<root level="ERROR" appenders="firebug"/>
<logger name="com.example" level="DEBUG" appenders="firebug" />
<appender name="firebug" class="org.log5f.appenders.FirebugAppender">
<param name="layout" value="org.log5f.layouts.PatternLayout" type="Class">
<param name="conversionPattern" value="%d{ABSOLUTE} %c{1} - %m%n" type="String"/>
</param>
</appender>
</configuration>;
Log5FConfigurator.configure(config);
Note: If source is not string configuration starts immediately.
From version 1.0 Log5F finds URL to configuration file in FlashVars, see more.
July 8, 2010 Leave a Comment
From version 1.0 Log5F can get url of the configuration file from the FlashVars. To configure Log5F from custom file use log5f parameter in HTML, for example:
<object id="index" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<param name="FlashVars" value="log5f=path_to_config.xml" />
<param name="src" value="index.swf" />
<param name="name" value="index" />
<embed id="index" type="application/x-shockwave-flash" width="100%" height="100%" src="index.swf" name="index" flashvars="log5f=path_to_config.xml"></embed>
</object>
See more about it on a Wiki Page.
July 6, 2010 Leave a Comment
Currently I work on next version of the Log5F, that will add some features to make configuration process easier. I use trunk folder for work with this version, but now this code is note stable. So if you need a source code of the stable version of the Log5F, please use next url:
http://log5f.googlecode.com/svn/tags/0.5