Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Log4jsModule.forRootAsync #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Description
This's a [log4js](https://github.com/log4js-node/log4js-node) module for [Nest](https://github.com/nestjs/nest).
This's a [log4js](https://github.com/log4js-node/log4js-node) module for [Nest@6](https://github.com/nestjs/nest).

## Installation

```bash
$ npm install nest-log4js
$ npm install nestjs-log4js
```

## Quick Start
Expand All @@ -18,7 +18,7 @@ If you want to Manual logger, see provider bottom, inject and log.
>app.module.ts

```ts
import { Log4jsModule } from 'nest-log4js';
import { Log4jsModule } from 'nestjs-log4js';
@Module({
imports: [
...
Expand All @@ -28,6 +28,21 @@ import { Log4jsModule } from 'nest-log4js';
export class AppModule {
}

```

```ts
@Module({
imports: [
ConfigModule.load(path.resolve(__dirname, '..', 'config', '*.{ts,js}')),
Log4jsModule.forRootAsync({
useFactory: (config: ConfigService) => config.get('log'),
inject: [ConfigService],
}),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
```
[Optional Settings](https://log4js-node.github.io/log4js-node/api.html)
is inspired by official settings
Expand Down Expand Up @@ -100,4 +115,4 @@ LOG4JS_ERROR_LOGGER

### Tips

If you use pm2, please look [clustering](https://log4js-node.github.io/log4js-node/clustering.html)
If you use pm2, please look [clustering](https://log4js-node.github.io/log4js-node/clustering.html)
Loading