0

We want to develop a core module using Spring Boot which has robust support for Logger with multiple cloud providers.

Hence, we choose to develop it using Spring LogBack.

Let's say if we have PCF or GCP as cloud platform, how can i enable the different appenders based on the Cloud Platform?

I know that there's a CloudPlatform(class), but don't know how to configure it for different platform on the fly.

S Atah Ahmed Khan
  • 1,313
  • 3
  • 14
  • 22

1 Answers1

1

I followed below approach to solve my problem.

In the CloudPlatform class, spring code checking two environment variables 'VCAP_APPLICATION' & 'VCAP_SERVICES' to detect the PCF environment.

I also used the same variables in the logback file using Janino Library to check whether those(variables) exists or not.

Hope this help some one..

S Atah Ahmed Khan
  • 1,313
  • 3
  • 14
  • 22