Update Loading mechanism instruction #1

Update Loading mechanism instruction (number 1 in priority) to match the current behaviour of the library.
This commit is contained in:
Leoni Murilo de Lima 2020-01-28 15:34:44 -03:00 committed by GitHub
parent 150b1f760a
commit 5679eed022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ Log4js can load appenders from outside its core set. To add a custom appender, t
When log4js parses your configuration, it loops through the defined appenders. For each one, it will `require` the appender initially using the `type` value prepended with './appenders' as the module identifier - this is to try loading from the core appenders first. If that fails (the module could not be found in the core appenders), then log4js will try to require the module using variations of the `type` value.
Log4js checks the following places (in this order) for appenders based on the type value:
1. The core appenders: `require('./appenders/' + type)`
1. The core appenders: `require('./' + type)`
2. node_modules: `require(type)`
3. relative to the main file of your application: `require(path.dirname(require.main.filename) + '/' + type)`
4. relative to the process' current working directory: `require(process.cwd() + '/' + type)`