Simmaco Ferriero
Simmaco Ferriero

Reputation: 129

Changing log format in SAP Cloud SDK doesn't work

I’ve created a new project from scratch using the SAP Cloud SDK archetype. In the project the logback.xml file is configured as this:

enter image description here

If I run the project I see the following log:

enter image description here

Now I would like to change the log format and for this reason I slightly modified the logback.xml file as this:

enter image description here

Unfortunately, running the app again I still see the same log. It seems that the logback.xml file is not taken into account.

enter image description here

Is there anything missing?

Simmaco

Upvotes: 1

Views: 242

Answers (2)

Tanvi Gupta
Tanvi Gupta

Reputation: 86

After further investigating we found out that one can achieve this by overriding resources in droplet by placing files in META-INF/sap_java_buildpack/resources/. For e.g. to override logback.xml for your tomee application you need to place it at path

/application/src/main/webapp/META-INF/sap_java_buildpack/resources/tomee7/conf”

For detailed explanation here is the SAP Cloud Platform link that you can refer Link

Also this overriding solution on CF is not recommended as it overrides many other log settings on Cloud Foundry. Therefore, unless one has a strong reason to change log format we would recommend not doing this.

Upvotes: 1

Tanvi Gupta
Tanvi Gupta

Reputation: 86

Apparently, with a tomee archetype the config file logback.xml is not taken into account on CF. Our assumption is that it can be achieved by "sap_java_buildpack" but currently we are further investigating this issue on how one can change log formats with tomee archetype on CF. In case you want to know how to configure log level in this environment, here is the documentation for it.

Regards, Tanvi

Upvotes: 2

Related Questions