Depending on your requirements, you can create a separate
log file for a given component in order to isolate the messages
logged by it. To do so, perform the following tasks: Navigate
to CRX DE Lite, for your server, typically it is http://<server>:<port>/crxde.
If you do not have a configuration folder create one for
your project such as: /apps/<component-name>/config
Under /apps/<component-name>/config, create a node
for the new Logger Configuration as follows: Name: org.apache.sling.commons.log.LogManager.factory.config-<identifier> (as this is a Logger)
where <identifier> is replaced by free text that you (must) enter to identify the instance (you cannot omit this information). For example, org.apache.sling.commons.log.LogManager.factory.config-ACM
Type: sling:OsgiConfig
Set the following properties on the above Logger node:
Name: org.apache.sling.commons.log.file
Type: String
Value: specify the Log File; for example, ../logs/assetcomposer.log
Name: org.apache.sling.commons.log.names
Type: String[] (String + Multi)
Value: specify the OSGi services for which the Logger is to log messages;
Configure the other parameters as required: Name: org.apache.sling.commons.log.pattern
Type: String
Value: specify the pattern of the log message as required
For example : {0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}
Your node structure and properties should be similar to:
Click Save All in CRX DE Lite, and your changes will
take effect immediately.
|
|
|