File: console.md

package info (click to toggle)
node-log4js 6.9.1%2B~cs8.4.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,468 kB
  • sloc: javascript: 12,965; makefile: 5
file content (19 lines) | stat: -rw-r--r-- 807 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Console Appender

This appender uses node's console object to write log events. It can also be used in the browser, if you're using browserify or something similar. Be aware that writing a high volume of output to the console can make your application use a lot of memory. If you experience this problem, try switching to the [stdout](stdout.md) appender.

# Configuration

- `type` - `console`
- `layout` - `object` (optional, defaults to colouredLayout) - see [layouts](layouts.md)

Note that all log events are output using `console.log` regardless of the event's level (so `ERROR` events will not be logged using `console.error`).

# Example

```javascript
log4js.configure({
  appenders: { console: { type: "console" } },
  categories: { default: { appenders: ["console"], level: "info" } },
});
```