Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to configuring preffix or suffix of log? #10

Open
Labels
@hemavidal

Description

There is a way to configure where the extended text will be placed in log message?

This:

log4js_extend(log4js, {
 path: __dirname,
 format: "at @name (@file:@line:@column)"
})
log4js.configure({
	appenders: { index: { type: 'file', filename: logpath, maxLogSize: 20480, backups: 10 }, out: { type: 'stdout' } },
	categories: { default: { appenders: ['index', 'out'], level: 'info' } }
})
const logger = log4js.getLogger('index')
logger.info('my info message')

Results in:

[2017年09月22日 13:58:31.517] [INFO] index - my info message at methodName (index.js:24:10)
And i want to modify to this:
[2017年09月22日 13:58:31.517] [INFO] index [methodName (index.js:24:10)] - my info message
There is a way to do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /