Layer7 API Management

Expand all | Collapse all

We want to customize the format of logged messages, something on the order of customizing log4j messages. 

  • 1.  We want to customize the format of logged messages, something on the order of customizing log4j messages. 

    Posted Oct 17, 2016 05:59 PM

    We want to customize the format of logged messages, something on the order of customizing log4j messages.  What options are available to us?  We have seen the documentation on "Customize the Audit Format for Logging", but it is not at all clear to us what that provides.

     

    We would like to log messages such as: 

     

    2016-10-14T16:30:15.292-0500 log_type="gateway" api="customer-service" request_id="UUID_generated_id" ...


  • 2.  Re: We want to customize the format of logged messages, something on the order of customizing log4j messages. 
    Best Answer

    Broadcom Employee
    Posted Oct 17, 2016 06:56 PM

    Good evening,

     

    You can modify the audit.log.service.headerFormat cluster wide property and set the value to: log_type="gateway" api="{3}" request_id="${requestId}"

     

    This will change the default from "2016-10-17T15:46:26.417-0700 INFO    32705 com.l7tech.server.message : Processing request for service: log [/log]"

    to

    "2016-10-17T15:54:26.419-0700 INFO    32768 com.l7tech.server.message : log_type="gateway" api="log [/log]" request_id="00000157c3fce83c-400""

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support