Created a custom log file for an Adobe Experience Manager project but logs are not coming in the file. | Community
Skip to main content
Level 2
July 19, 2018
Solved

Created a custom log file for an Adobe Experience Manager project but logs are not coming in the file.

  • July 19, 2018
  • 5 replies
  • 2297 views

I have configured below osgi config node:

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"

    jcr:primaryType="sling:OsgiConfig"

    org.apache.sling.commons.log.file="logs/conditional-service.log"

    org.apache.sling.commons.log.level="info"

    org.apache.sling.commons.log.names="[com.project.platform]"

    org.apache.sling.commons.log.pattern="\{0,date,yyyy-MM-dd HH:mm:ss.SSS} {4} [{3}] {5}"/>

But after configuring this I am not getting the logs which are in the file under com.project.platform package are not logging into file logs/conditional-service.log. However I can see the empty file conditional-service.log under logs directory. While creating log file from log support I am getting the logs.

I have used the steps mentioned here in Creating a custom log file for an Adobe Experience Manager project

Let me know If I am missing something. I am using AEM 6.3.2.0

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Peter_Puzanovs

Dear Manasip,

The fact that the log file got created in a first place is good. it means that the log service has registered.

Are you logging with the info and higher level's to this file?

How are you registering your logger through .java code?

Do you have any other log file that could be stealing output from this file?

Are you using correct API's?

Regards,

Peter

5 replies

Peter_Puzanovs
Community Advisor
Peter_PuzanovsCommunity AdvisorAccepted solution
Community Advisor
July 19, 2018

Dear Manasip,

The fact that the log file got created in a first place is good. it means that the log service has registered.

Are you logging with the info and higher level's to this file?

How are you registering your logger through .java code?

Do you have any other log file that could be stealing output from this file?

Are you using correct API's?

Regards,

Peter

smacdonald2008
Level 10
July 20, 2018

Did you follow the Step in the Configuration exactly as is. This was tested a few months back and it worked perfectly.

smacdonald2008
Level 10
July 20, 2018

However - this was a 6.4 article. I am not sure if AEM 6.3 has differences that would explain why its not working.

VeenaVikraman
Community Advisor
Community Advisor
July 20, 2018

I would recommend you to do a line bymline debug which might be helpful in this case. Just add few log statements starting from the starting point of your method and make sure your method or class is getting invoked.

manasipAuthor
Level 2
July 20, 2018

Thanks Peter, I was having other log file that is stealing output from this file.