Log4js

From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search
Log4js
File:Log4js.png
Log4js Logo
Developer(s) Stephan Strittmatter, Seth Chisamore
Stable release 1.0 / August 4, 2008
Operating system Windows, Linux, Mac OS
Type Framework
License Apache Software Foundation
Website http://log4js.berlios.de

Log4js is a framework written in JavaScript to log application events.

The framework is very close to the API of Log4j. It is also available under the licence of Apache Software Foundation.

Contents

Functionality

File:Log4JS-UML.jpg
class diagram

The base concept is identical to Log4j. The same log levels and almost all methods are identical.

One special feature of Log4js is the ability to log the events of the browser remote on the server. Using Ajax it is possible to send the logging events in several formats (XML, JSON, plain ASCII etc.) to the server to be evaluated there.

Appender

Following appenders are implemented currently:

AjaxAppender
Sends the logs via XmlHttpRequest (Ajax) to the server to be processed there.
ConsoleAppender
Logs within the HTML page or in a separate window.
FileAppender
Writes to a local file (Internet Explorer and Mozilla supported).
JSConsoleAppender
Appender for the JavaScript Console of Mozilla, Opera and Safari.
MetatagAppender
Adds the log events to Metatags in the DOM of document.
WindowsEventsAppender
Using Internet Explorer it is possible to log to Windows System Events.

Layout

The Layout classes are for different formattings of the events:

BasicLayout
Simple textual output of the events.
HtmlLayout
Formats the event as HTML <div>-element.
JSONLayout
Converts the events to JSON-objects which are readable in many other programming languages like Perl, PHP and Java.
XMLLayout
XML formatted output.

External links

es:Log4js

Personal tools

Served in 0.138 secs.