Servoy Plugins
Home
Table-Bean
XML-Plugin
MailPro-Plugin
DialogPro-Plugin
UserManager-Plugin
Google-Plugin
Exchange plugin
Phone-Plugin
FileWatcher-Plugin
TrayIcon-Plugin
PDI-Plugin
DateUtils-Plugin
Log-Plugin
ScreenShot-Plugin

Log plugin for Servoy
State-of-the-art logging inside your Servoy code

The Log-Plugin for Servoy wraps the power of log4j in a simple Servoy plugin. Developers can easily add comments to their code that will be outputted to the console (or a client trace file), a log file or the Servoy server's log.

What gets written to the log depends on the priority the developer gave to the message. These priorities are available:

TRACE plugins.Log.trace(aMessage)
DEBUG plugins.Log.debug(aMessage)
INFO plugins.Log.info(aMessage)
WARN Plugins.Log.warn(aMessage)
ERROR Plugins.Log.error(aMessage)
FATAL Plugins.Log.fatal(aMessage)

The level that is outputted can be set at runtime. If the plugin is set to plugins.Log.debugLevel("WARN"), only messages of priority WARN, ERROR and FATAL will be outputted.

Most developers use application.output(aMessage) during development and comment those out during deployment. With the Log-Plugin these messages can remain in the code for later debugging. By setting the priority to ERROR for exampe during deployment, debugging output can be prevented but still be accessible.

The plugin supports i18n messages, allows configuration of how messages are outputted, can output to the status area and display status area warning messages (shown in red).

Here is a short sample code that demonstrates the functionality:

// Set the Level from which on messages are outputted
plugins.Log.debugLevel = 'INFO';

// Create a log file to enable logging to a file
plugins.Log.logFilePath = 'C:\\test.log';

// Set the pattern in which messages are outputted
plugins.Log.outputPattern = '%s %p %d{HH:mm:ss.S}: %m%n';

// Output some messages
plugins.Log.trace('This is a trace message'); // Will not be outputted if debugLevel is 'INFO'
plugins.Log.debug('This is a debug message'); // Will not be outputted if debugLevel is 'INFO'
plugins.Log.info('This is a info message');
plugins.Log.warn('This is a warn message');
plugins.Log.error('This is a error message');
plugins.Log.fatal('This is a fatal message');

The output could look like this (depending on the outputPattern):

yourSolution 14:00:00.000 DEBUG: creating 100 records took 4375ms

The Log-Plugin is free, but requires registration. A free license key can be obtained from here.

Try it
 
News
Version history
 
Shop
Downloads
Company
Contact
Services

SAN Partner

 

Follow us:
Twitter Facebook
Twitter Twitter

 

         
Legal notice        © 2007-2011 Servoy-Plugins.de        Terms and conditions