문서 메뉴
문서 홈
/ / /
Node.js 드라이버
/

로깅

이 페이지의 내용

  • 임시 대안

중요

드라이버는 버전 4.0 이상에서 로거를 사용하지 않습니다. 이 버전에서 이전 로거 설정을 사용하려고 하면 로그에 아무 것도 출력되지 않습니다.

대신 모니터링 가이드를 참조하세요.

  • 명령 모니터링

  • 클러스터 모니터링

  • 연결 풀 모니터링

새로운 로깅 프레임워크를 개발 중입니다. 그동안 다음 스니펫을 사용하여 모니터 이벤트를 출력할 수 있습니다.

const uri = "mongodb+srv://<user>:<password>@<cluster-url>?writeConcern=majority";
const client = new MongoClient(uri, { monitorCommands:true });
client.on('commandStarted', (event) => console.debug(event));
client.on('commandSucceeded', (event) => console.debug(event));
client.on('commandFailed', (event) => console.debug(event));
← 데이터 정렬.

이 페이지의 내용