Skip to content

Commit

Permalink
chore(docs): updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lamweili committed May 11, 2022
1 parent 480c81a commit 126e286
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/connect-logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ app.use(log4js.connectLogger(logger, {

When you request of POST, you want to log the request body parameter like JSON.
The log format function is very useful.
Please use log format function instead tokens property for use express's request or response.
Please use log format function instead "tokens" property for use express's request or response.


```javascript
Expand Down
2 changes: 1 addition & 1 deletion docs/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The file appender writes log events to a file. It supports an optional maximum f
* `type` - `"file"`
* `filename` - `string` - the path of the file where you want your logs written.
* `maxLogSize` - `integer` (optional, defaults to MAX_SAFE_INTEGER) - the maximum size (in bytes) for the log file.
* `backups` - `integer` (optional, defaults to 5) - the number of old log files to keep during log rolling.
* `backups` - `integer` (optional, defaults to 5) - the number of old log files to keep during log rolling (excluding the hot file).
* `layout` - (optional, defaults to basic layout) - see [layouts](layouts.md)

Any other configuration parameters will be passed to the underlying [streamroller](https://github.com/nomiddlename/streamroller) implementation (see also node.js core file streams):
Expand Down
2 changes: 1 addition & 1 deletion docs/fileSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The sync file appender writes log events to a file, the only difference to the n
* `type` - `"fileSync"`
* `filename` - `string` - the path of the file where you want your logs written.
* `maxLogSize` - `integer` (optional) - the maximum size (in bytes) for the log file. If not specified or 0, then no log rolling will happen.
* `backups` - `integer` (optional, defaults to 5) - the number of old log files to keep during log rolling.
* `backups` - `integer` (optional, defaults to 5) - the number of old log files to keep during log rolling (excluding the hot file).
* `layout` - (optional, defaults to basic layout) - see [layouts](layouts.md)

Any other configuration parameters will be passed to the underlying node.js core stream implementation:
Expand Down
36 changes: 18 additions & 18 deletions types/log4js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const levels: Levels;

export function shutdown(cb?: (error: Error) => void): void | null;

export interface BaseLayout {
export interface BasicLayout {
type: 'basic';
}

Expand Down Expand Up @@ -88,7 +88,7 @@ export interface CustomLayout {
type: string;
}

export type Layout = BaseLayout | ColoredLayout | MessagePassThroughLayout | DummyLayout | PatternLayout | CustomLayout;
export type Layout = BasicLayout | ColoredLayout | MessagePassThroughLayout | DummyLayout | PatternLayout | CustomLayout;

/**
* Category Filter
Expand Down Expand Up @@ -125,7 +125,7 @@ export interface NoLogFilterAppender {
*/
export interface ConsoleAppender {
type: 'console';
// defaults to colouredLayout
// (defaults to ColoredLayout)
layout?: Layout;
}

Expand All @@ -135,9 +135,9 @@ export interface FileAppender {
filename: string;
// (defaults to MAX_SAFE_INTEGER) the maximum size (in bytes) for the log file.
maxLogSize?: number | string;
// (defaults to 5) the number of old log files to keep.
// (defaults to 5) the number of old log files to keep (excluding the hot file).
backups?: number;
// (defaults to basic layout)
// (defaults to BasicLayout)
layout?: Layout;
// (defaults to utf-8)
encoding?: string;
Expand All @@ -157,9 +157,9 @@ export interface SyncfileAppender {
filename: string;
// (defaults to undefined) the maximum size (in bytes) for the log file. If not specified or 0, then no log rolling will happen.
maxLogSize?: number | string;
// (defaults to 5) the number of old log files to keep.
// (defaults to 5) the number of old log files to keep (excluding the hot file).
backups?: number;
// (defaults to basic layout)
// (defaults to BasicLayout)
layout?: Layout;
// (defaults to utf-8)
encoding?: string;
Expand All @@ -186,7 +186,7 @@ export interface DateFileAppender {
* - O : timezone (capital letter o)
*/
pattern?: string;
// (defaults to basic layout)
// (defaults to BasicLayout)
layout?: Layout;
// (defaults to utf-8)
encoding?: string;
Expand All @@ -210,7 +210,7 @@ export interface LogLevelFilterAppender {
appender: string;
// the minimum level of event to allow through the filter
level: string;
// (defaults to FATAL) - the maximum level of event to allow through the filter
// (defaults to FATAL) the maximum level of event to allow through the filter
maxLevel?: string;
}

Expand All @@ -228,11 +228,11 @@ export interface MultiprocessAppender {
type: 'multiprocess';
// controls whether the appender listens for log events sent over the network, or is responsible for serialising events and sending them to a server.
mode: 'master' | 'worker';
// (only needed if mode == master)- the name of the appender to send the log events to
// (only needed if mode == master) the name of the appender to send the log events to
appender?: string;
// (defaults to 5000) - the port to listen on, or send to
// (defaults to 5000) the port to listen on, or send to
loggerPort?: number;
// (defaults to localhost) - the host/IP address to listen on, or send to
// (defaults to localhost) the host/IP address to listen on, or send to
loggerHost?: string;
}

Expand All @@ -242,13 +242,13 @@ export interface RecordingAppender {

export interface StandardErrorAppender {
type: 'stderr';
// (defaults to colouredLayout)
// (defaults to ColoredLayout)
layout?: Layout;
}

export interface StandardOutputAppender {
type: 'stdout';
// (defaults to colouredLayout)
// (defaults to ColoredLayout)
layout?: Layout;
}

Expand All @@ -259,13 +259,13 @@ export interface StandardOutputAppender {
*/
export interface TCPAppender {
type: 'tcp';
// defaults to 5000
// (defaults to 5000)
port?: number
// defaults to localhost
// (defaults to localhost)
host?: string
// default to __LOG4JS__
// (defaults to __LOG4JS__)
endMsg?: string
// defaults to a serialized log event
// (defaults to a serialized log event)
layout?: Layout;
}

Expand Down

0 comments on commit 126e286

Please sign in to comment.