I have a java application deployed in GCP . Pointed that log file to Stackdriver logging using fluentd .
Java exception log
was formatted in a separate line. So Stackdriver logging unable to capture it as error/ warning .
I need to format my java application exception trace in a single line . Need to differentiate info , error , warning .
My fluentd configurations :
<source>
type tail
format none
path /home/app/*-local-app-output.log
pos_file /var/lib/google-fluentd/pos/local-app.pos
read_from_head true
tag local-app
</source>
Also tried with
format multiline
format_firstline /\d{4}-\d{1,2}-\d{1,2}/
format1 /^(?<time>\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}) \[(?<thread>.*)\] (?<level>[^\s]+)(?<message>.*)/
time_format %b %d %H:%M:%S
Whereas Deploying the same application in Kubernetes engine , it has separate log Category field as : info , warn , error , critical .
Can any one help me on this ?