|
@@ -22,12 +22,12 @@ const formatMeta = (meta) => {
|
|
|
|
|
|
const customFormat = format.printf(({ timestamp, level, message, label = "", ...meta }) => `[${timestamp}] ${level} ${label} ${message} ${formatMeta(meta)}`);
|
|
|
|
|
|
-const apm = APM.start({
|
|
|
- serverUrl: 'http://localhost:8200',
|
|
|
- // Set the service environment
|
|
|
- environment: 'production'
|
|
|
- // NDNpS0lZQUJPcU1OdjVQSHhKeGY6N3ZuVWNIVWpTc0dRZ2pIa0tBckxOQQ==
|
|
|
-})
|
|
|
+// const apm = APM.start({
|
|
|
+// serverUrl: 'http://localhost:8200',
|
|
|
+// // Set the service environment
|
|
|
+// environment: 'production'
|
|
|
+// // NDNpS0lZQUJPcU1OdjVQSHhKeGY6N3ZuVWNIVWpTc0dRZ2pIa0tBckxOQQ==
|
|
|
+// })
|
|
|
|
|
|
// const client = new Client({
|
|
|
// node: 'http://localhost:9200',
|
|
@@ -35,24 +35,24 @@ const apm = APM.start({
|
|
|
// })
|
|
|
|
|
|
|
|
|
-const esTransportOpts = {
|
|
|
- level: 'info',
|
|
|
- indexPrefix: 'logging-api',
|
|
|
- indexSuffixPattern: 'YYYY-MM-DD',
|
|
|
- clientOpts : {
|
|
|
- node: 'http://localhost:9200',
|
|
|
- maxRetries: 5,
|
|
|
- requestTimeout: 10000,
|
|
|
- sniffOnStart: false,
|
|
|
- // apiKey: 'SDNncElZQUJPcU1OdjVQSFRaY0I6MGpLUWg2TldSS0tTSjdRS0FfZGZGdw=='
|
|
|
- auth: {
|
|
|
- username: 'elastic',
|
|
|
- password: 'changeme'
|
|
|
- }
|
|
|
- },
|
|
|
- source: 'socket-api'
|
|
|
-}
|
|
|
-const esTransport = new ElasticsearchTransport(esTransportOpts);
|
|
|
+// const esTransportOpts = {
|
|
|
+// level: 'info',
|
|
|
+// indexPrefix: 'logging-api',
|
|
|
+// indexSuffixPattern: 'YYYY-MM-DD',
|
|
|
+// clientOpts : {
|
|
|
+// node: 'http://localhost:9200',
|
|
|
+// maxRetries: 5,
|
|
|
+// requestTimeout: 10000,
|
|
|
+// sniffOnStart: false,
|
|
|
+// // apiKey: 'SDNncElZQUJPcU1OdjVQSFRaY0I6MGpLUWg2TldSS0tTSjdRS0FfZGZGdw=='
|
|
|
+// auth: {
|
|
|
+// username: 'elastic',
|
|
|
+// password: 'changeme'
|
|
|
+// }
|
|
|
+// },
|
|
|
+// source: 'socket-api'
|
|
|
+// }
|
|
|
+// const esTransport = new ElasticsearchTransport(esTransportOpts);
|
|
|
|
|
|
|
|
|
const logger = createLogger({
|
|
@@ -73,7 +73,7 @@ const logger = createLogger({
|
|
|
new transports.File({
|
|
|
filename: join(__dirname, "../../logs/combined.log"),
|
|
|
}),
|
|
|
- esTransport
|
|
|
+ // esTransport
|
|
|
],
|
|
|
});
|
|
|
export { logger };
|