import { format } from 'winston' ; import { TransformableInfo } from 'logform' ; import { getMessageOrStack } from './local' ; const { combine , timestamp , json } = format ; const errors = format . errors || require ( 'logform/errors' ) ; /**
 * Format for logging in Kibana.
 */ export const kibana = combine ( errors ( { stack : true } ) , timestamp ( ) , format ( kibanaTransformer ) ( ) , json ( ) ) ; function kibanaTransformer ( info ) { return { ... info , msg : getMessageOrStack ( info ) , written_ts : new Date ( info . timestamp ) . getTime ( ) , written_at : info . timestamp } ; }