2017-12-12 11 views
0

예상대로 작동하지 않습니다.하지만 내가 할 때 console.log가, console.errorconsole.warnconsole.info 모든 로그는 일반 텍스트로 인쇄지고 있지만, 좋은 플러그인 방식이 아닙니다.좋은 모듈이 내가있는 게요 서버에 좋은 플러그인을 등록하고 내 모든 응답은 로그인지고

누구도 내가 놓친 것일 수 있습니다.

내가 읽고 다음과 같은 문서 :

답변

0

을 console.log 자연스럽게 콘솔에 간다. 당신이 같이 사용 무언가를 콘솔에 물건을 인쇄하려면 :

request.server.log(['error', 'contentFetch'], err);

이 내 좋은 플러그인 구성이 어쩌면 당신은 도랑 무언가가 당신을 위해 작동 찾을 수 있습니다.

logging: { 
     $filter: 'env', 
     production: { 
      reporters: { 
       file: [{ 
        module: 'good-squeeze', 
        name: 'Squeeze', 
        args: [{error: '*', log: ['error'], ops: '*'}] 
       }, { 
        module: 'good-squeeze', 
        name: 'SafeJson', 
        args: [ 
         null, 
         {separator: '\n'} 
        ] 
       }, { 
        module: 'rotating-file-stream', 
        args: [ 
         'error.log', 
         { 
          size: '10M', // rotate every 10 MegaBytes written 
          interval: '1d', // rotate daily 
          compress: 'gzip', // compress rotated files 
          path: './logs' 
         } 
        ] 
       }] 
      } 
     }, 
     $default: { 
      ops: { 
       interval: 1000 
      }, 
      reporters: { 
       console: [{ 
        module: 'good-squeeze', 
        name: 'Squeeze', 
        args: [{log: '*', response: '*'}] 
       }, { 
        module: 'good-console' 
       }, 'stdout'] 
      } 
     } 
    }, 

{ 
     plugin: { 
      register: 'good', 
      options: Config.get('/logging') 
     } 
    } 
처럼 등록