8
8
9
9
Log4js - The Logging Framework for JavaScript
10
10
11
- ### Moved to Github
12
- Since March 2014 the new location of Log4js is at Github!
13
- The Framework was hosted on log4js.berlios.de for a long time.
11
+ ## Usage
14
12
15
- The website of Log4js: http://stritti.github.io/log4js/
13
+ Add the JavaScript file to head of HTML page:
14
+ ```` html
15
+ <head >
16
+ <script src =" log4js.min.js" type =" text/javascript" ></script >
17
+ </head >
16
18
17
- ### Development
19
+ ````
20
+ Add script for instantiation of Logger:
21
+ ```` javascript
22
+ let consoleLog = new Log4js.Logger (" consoleTest" );
23
+ consoleLog .setLevel (Log4js .Level .ALL );
24
+ let consoleAppender = new Log4js.ConsoleAppender (true );
25
+ consoleLog .addAppender (consoleAppender);
26
+
27
+ ````
28
+ Then you are able to add logging event:
29
+ ```` javascript
30
+ consoleLog .trace (' I was traced!' )
31
+ ````
32
+
33
+ Within sources there is a more detailed [ example] ( log4js/src/main/example/index.html ) .
34
+
35
+ ## Development
18
36
To build the JavaScript library we use [ npm] ( https://www.npmjs.com/ ) and [ grunt] ( https://gruntjs.com/ ) .
19
37
20
38
````
@@ -25,7 +43,20 @@ grunt build
25
43
26
44
Include then the ` target/log4js.min.js ` file in your project.
27
45
28
- ### Node.js
29
- There is a fork of log4js framework working with node.js: https://github.com/nomiddlename/log4js-node
46
+ More details in the [ Wiki] ( https://github.com/stritti/log4js/wiki/Development )
47
+
48
+ ## Contribution
49
+
50
+ Pull Requests are very welcome.
51
+
52
+ ## Other JavaScript Logger
53
+ There are a lot other projects which are started logging in JavaScript:
54
+
55
+ There is a very active fork of current log4js framework modified for node.js usage: https://github.com/nomiddlename/log4js-node
56
+
57
+ Further loggers could be found (and added!) in the [ Wiki] ( https://github.com/stritti/log4js/wiki/JavaScript-Logger ) .
58
+
59
+ # License
60
+ [ LICENSE.txt] ( LICENSE.txt )
30
61
31
- [ ![ Analytics] ( https://ga-beacon.appspot.com/UA-327996-12/stritti/log4js )] ( https://github.com/igrigorik/ga-beacon ) ![ license-image ] ( http://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat ) [ license-url ] ( LICENSE.txt )
62
+ [ ![ Analytics] ( https://ga-beacon.appspot.com/UA-327996-12/stritti/log4js )] ( https://github.com/igrigorik/ga-beacon )
0 commit comments