Message Logging policy -- dynamic file names

Not applicable

In Message Logging policy, I am using a variable in place of <FileName> as shown below.

<FileName>{request.header.logFilePath}</FileName>

Now, I am seeing log.root.dir in message-logging.properties is not setup (commented out). In this case, would I be able to pass the entire file path from root directory for <FileName> like /api/logs/dept1/test.log or /api/logs/dept2/test.log? I'm not seeing the log files getting created. Is this because the "log.root.dir" property not setup? Also, if I set the log.root.dir as "/api/logs", would I be able to use the file path variable for <FileName> contain the value "dept1/test.log" in this example?

The documentation says --If you set this to an absolute path, such as log.root.dir=/opt/apigee4/var/log/messages, message logs will be stored in/opt/apigee4/var/log/messages/messagelog/.

Does this mean "messagelog" sub-directory needs to be created in my path like /api/logs/messagelog/dept1/test.log so that I can point log.root.dir in message-logging.properties file to /api/logs and I can have <FileName> in message logging policy point to "dept1/test.log" or "dept2/test.log"?

Your help is appreciated. Thanks in advance.

0 1 322
1 REPLY 1

Not applicable

This is on-prem with 16.01 version. Looks like the documentation provided in message logging policy doesn't apply anymore in ver 16.01. Is there a new way of configuring log.root.dir ?