5

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

Current displaying output: enter image description here

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 ?

soundararajan.c
  • 2,538
  • 6
  • 29
  • 51

0 Answers0