简体   繁体   中英

Display Cloudhub Logs in Json Pattern along with Custom fields

Our client is not interested in using any 3rd party Logger like JSON Logger or any other logger comnectors available. So is there any way to modify the default Anypoint Logging pattern in cloudhub in Json format like how a Json Logger does. Is there any way to add custom fields using default logger like api_name or flow_start_time, end_time? Currently I am creating a variable and defining required fields in a Json pattern and further configure the variable in the default logger which is a workaround and working fine but its just I was curious if this is possible in some easier way without writing any dwl?

You can add custom variables using Mule 4.4 MDC logging feature. Note that it is not available with previous versions.

You can also request to override the default logging configuration in CloudHub, otherwise the log4j2.xml in the application is ignored, and try to use the JsonLayout. I don't recommend it though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM