xcally-nest-library 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xcally-nest-library",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,6 +16,7 @@ export class LoggerModule {
16
16
  imports: [ConfigModule],
17
17
  inject: [ConfigService],
18
18
  useFactory: async (config: ConfigService) => {
19
+ const projectName = process.env.npm_package_name || 'default_project';
19
20
  return {
20
21
  pinoHttp: {
21
22
  level: config.get('LOG_LEVEL') || 'info',
@@ -52,7 +53,7 @@ export class LoggerModule {
52
53
  level: 'info',
53
54
  target: 'pino/file',
54
55
  options: {
55
- destination: './logs/info.log',
56
+ destination: `./logs/${projectName}-info.log`,
56
57
  mkdir: true,
57
58
  append: process.env.NODE_ENV !== 'production' ? false : true,
58
59
  },