官术网_书友最值得收藏!

  • WSO2 Developer’s Guide
  • Fidel Prieto Estrada Ramón Garrido Lázaro
  • 129字
  • 2021-07-08 10:06:00

The log mediator

The log mediator allows us to show and save some information in the console and server log, which is useful to audit the services.

Now, let's look at the syntax:

<log [level="string"] [separator="string"]>
    <property name="string" (value="literal" | expression="[XPath|json- 
eval(JSON Path)]")/>* </log>

We have six different categories, sorted by informational purpose to error logs:

  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
  • FATAL

We also have four levels of log:

  • Custom: Show the properties configured inside
  • Full: The Show To, From, WSAction, SOAPAction, ReplyTo, and MessageID headers and the current payload
  • Headers: Log all the SOAP headers
  • Simple: Log To, From, WSAction, SOAPAction, ReplyTo, and MessageID headers

For example, to log the full content of the payload, we can use the following syntax:

<log level="full"/>

Alternatively, to only log a custom property, use this:

<log category="INFO" separator=",">
    <property name="dynamicProperty"                  
expression="http://xpathExpression" /> </log>
By default, the log is placed at: <WSO2_HOME>/repository/log/wso2carbon.log.
主站蜘蛛池模板: 南宫市| 浦北县| 南通市| 蕲春县| 禄丰县| 星子县| 遵化市| 大悟县| 天柱县| 万载县| 青河县| 依安县| 海阳市| 泸西县| 叶城县| 江津市| 印江| 阿克| 武川县| 和政县| 利津县| 沾化县| 交城县| 宿迁市| 怀安县| 芷江| 长武县| 兴业县| 乐陵市| 嘉善县| 玉树县| 金门县| 庆城县| 平邑县| 南康市| 彰化县| 宁津县| 汉中市| 姜堰市| 姚安县| 义乌市|