|
|
|
|
| Advertise on this site |
Ajax development is easier when you have a logging system like this:
<!--googleAd--> Log4js - The Logging API for JavaScript
Log4js is a logging API for JavaScript. The main goal is to have a robust and solid logging API which is very simmilar to the Java logging API Log4j.
The current available Appenders are:
Many Appender can be used in same time.
Log4js is a simple API, which could be included in your scripts:
<script src="log4js.js" type="text/javascript"></script>
<script type="text/javascript">
<!-- //
//initialize the logger with your category
var logger = Log4js.getLogger("ajaxTest");
//set the level of logging
logger.setLevel(Log4js.Level.ALL);
//set the Appender to write the log to
logger.addAppender(new AjaxAppender(logger, "./log4j.jsp"));
// --> </script>
Now you can call the log in your logic like follow line:
<input type="button" name="trace" value="Trace"
onclick="logger.trace('I was traced!');return false;" />
For more details have a look at the users guide.
log4javascript is a JavaScript logging framework based on the Java logging framework log4j.
Enhancements in 1.3 include:
As of MochiKit 1.3, the default logger will log all messages to your browser's native console. This is currently supported in Safari, Opera 9, and Firefox when the FireBug extension is installed. MochiKit 1.4 adds support for the relevant APIs for Internet Explorer (the Debugger and the Atlas framework, see here).
The Logger Control provides a simple way to read or write log messages with a single line of code. With this control, you can tap into the rich event-driven messages included with the YUI Library's debug files; This messaging allows you to get a fuller picture of the inner workings of any YUI Library component. The Logger Control provides a simple messaging interface that allows you to filter, pause, resume, and clear log messages on your screen. Whether or not you invoke this UI, you can monitor log output via the FireBug extension for Firefox or via the Safari JavaScript console. The Logger Control supports logging messages with customizable categories and sources. Adventurous developers can extend Logger to build their own implementations to suit any requirement.


Amazing ,how can he do that!
I like this post. It help me
pretty! I wish you can keep
Thanks for sharing the post!
I can use it in
That's very nice plugin! I
These tips help me a lot!
Thanks for sharing the post!
Very good plugin! I like it!
it does work - as someone
Comments