2

I have deployed my 2 java applications( ant and maven based) in gcp compute engine , i wish to connect those log files to GCP stackdriver logging .

Can any one help me on this out ?

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

1 Answers1

1

You need to configure the logging agent, see here: https://cloud.google.com/logging/docs/agent/installation

You can use the stackdriver logging library for java: https://cloud.google.com/logging/docs/setup/java

That being said, if all you need to run is some java applications, it probably makes more sense to deploy them in appengine standard (or flex, depending on needs), where logging is configured out of the box.

somethingsomething
  • 1,746
  • 6
  • 8
  • above can be used to configure for server level activities say webserver logs , syslog .., not based on application level – soundararajan.c Oct 05 '18 at 09:11
  • You absolutely can stream application logs with fluentd, but apparently google also provides a java specific library, so that should be easier to set up. I've updated the answer. – somethingsomething Oct 05 '18 at 09:31
  • I used the same fluentd to stream the java application by creating a configurations for the application .. – soundararajan.c Oct 05 '18 at 10:00
  • Will it possible to through alerts if the application logs has any exception or error in stackdriver logging ? – soundararajan.c Oct 05 '18 at 10:00
  • configured the logs using fluentd , but in logs it is showing under "any" category. It is not separated as warnings , info , error , critical type – soundararajan.c Oct 11 '18 at 13:28