fix(*): Make the elasticsearch logging render out log data correctly for filtering in kibana

This commit is contained in:
2021-02-14 19:13:29 +00:00
parent 939a99b62d
commit c3fcc15f06
2 changed files with 9 additions and 5 deletions
+5 -4
View File
@@ -11,16 +11,17 @@ if (process.env.NODE_ENV === 'production') {
const esTransportOpts = {
level: 'error',
indexPrefix: 'logs_denbot',
clientOpts: {
host: config.elasticsearchhost,
host: config.elasticsearch.elasticsearch_address,
log: 'error'
},
transformer: logData => {
return {
"@timestamp": (new Date()).getTime(),
timestamp: new Date().toISOString(),
severity: logData.level,
message: `${getCurrentDateAndTime()} - ${logData.message}`,
fields: {
message: logData.message,
meta: {
app: 'denBot',
env: env
}