Bug 36961 - log4js - Logging for JavaScript
Summary: log4js - Logging for JavaScript
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: P3 enhancement
Target Milestone: ---
Assignee: log4j-dev
Depends on:
Reported: 2005-10-07 10:36 UTC by Stephan Strittmatter
Modified: 2008-08-02 09:47 UTC (History)
0 users

initial version of log4js (6.99 KB, text/plain)
2005-10-07 10:39 UTC, Stephan Strittmatter
improved version that supports multiple appenders (8.87 KB, text/plain)
2005-11-16 20:08 UTC, Seth Chisamore

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Strittmatter 2005-10-07 10:36:51 UTC
I know, this is the Bugzilla of log4j, but I do not know wher I could provide on
the other hand my issue.

I created a JavaScript to provide logging also to my JavaScripts. The API is - I
think - rather the same, than in log4j.

Probably this could be added also to the project general logging project to
share and improve it.
Comment 1 Stephan Strittmatter 2005-10-07 10:39:11 UTC
Created attachment 16615 [details]
initial version of log4js
Comment 2 Marc Guillemot 2005-11-15 16:23:58 UTC
I think that a good js logging "library" could be really helpfull.

What about:
- using dhtml to add the messages to the log window
- using arguments.caller.callee to provide information about the calling function
- use the stacktrace to catch the line number
- provide the possibility to send the messages to the server (via XMLHttpRequest
or the src of an Image) and provide a Servlet as "bridge" to log4j
- in the case of use in a Firefox Extension, provide an Appenders to the
JavaScript Console, or to a File (works perhaps for a Webapp with some changes
in user.js)
Comment 3 Stephan Strittmatter 2005-11-16 10:52:53 UTC
The bridge via AJAX to log4j is currently in work! Ihad also this idea already :-)
At http://jroller.com/page/stritti I will provide my progress in the next days.

If you have more detailed ideas do not hesitate to provide them.

Comment 4 Seth Chisamore 2005-11-16 20:08:45 UTC
Created attachment 16977 [details]
improved version that supports multiple appenders

I've cleaned the log4js code up a little and have also added the ability to
have a message write to multiple appenders.  Just declare the appenders with
setAppdender like normal, except set more than one:

var log = new Logger(LogLevel.TRACE);
log.setAppender(new MetaAppender());
log.setAppender(new WindowAppender());

I have also added two new appenders:

    * FileAppender - This appender logs all messages to a log file.  This will
only work in IE or an HTA application.
    * WindowsEventAppender - This appender logs all messages to the Windows
Event Log.  This will only work in IE or an HTA application.

Even though both appenders only work on Windows and in IE they are very useful
for those of us who use JavaScript/JScript in our HTA development.
Comment 5 Stephan Strittmatter 2005-11-18 23:37:15 UTC
Seth and I improve the library more and more. Currently we have no repository to
share the sources and we use email and webspaces to share the files.
I will report the main progress always on
http://jroller.com/page/stritti/Weblog?catname=%2Flog4js , but it would be
greate, if we would be allowed to share our sources probably in sandbox. 

Please let me know what I have to improve to get involved in sandbox.
Comment 6 Stephan Strittmatter 2005-11-23 15:17:24 UTC
Currently log4js is hosted at 


Hopefully get it worth in future for Apache.
Comment 7 Stephan Strittmatter 2006-07-05 10:50:12 UTC
Have a look at http://log4js.berlios.de/ there is also a wiki added now to
improve documentation and comunication.
Comment 8 Thorbjørn Ravn Andersen 2008-08-02 09:47:22 UTC
If this project is still active, I will suggest that it should go in the Apache Incubator.

Please see http://incubator.apache.org/ for details.

This issue is set to INVALID