Skip to main content
Level 3
Oct 16, 2023 9:30 AM UTC
Solved

AEM error Logger statements are printing twice

Hi All,

 

Logger statements are printed twice but the code executes only once. Any idea on this?

 

I verified in local Windows stand-alone and Cloudfront servers that also same issue logger statements are printing 2 times.

 

AEM: 6.5.13.0

 

Regards,

Shyam

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sady_Rifat
Sady_RifatAccepted solution
Community Advisor
Oct 16, 2023 10:59 AM UTC

Since in your project, the log is pointing to error.log it actually did this->

  1. Your Project OSGI config prints the error log
  2. The default configuration `Apache Sling Logging Logger Configuration` also prints in the same file. See more-> https://experienceleague.adobe.com/docs/experience-manager-65/deploying/configuring/configure-logging.html?lang=en.
    You can find this default configuration in the OSGI config.
     

4 replies

Sady_Rifat
Community Advisor
Community Advisor
Oct 16, 2023 9:37 AM UTC

Hello @shyamasundar-ks ,

I hope you are not watching error logs from logs/error.log

In your project make sure the log file is different,

One copy of the log will be written by sling in error.log.

Translate
Level 3
Oct 16, 2023 9:43 AM UTC

Hi @sady_rifat ,

 

Thanks for the reply, Yes I am referring to logs/error.log. But in my previous experience, I have never come across like this even though I used to refer logs/error.log.

 

Please can you brief me more about why 2 times printing in error.log? It will be helpful for me to understand better and  I can convey to the team about this.

 

 

 

Translate
Sady_Rifat
Community Advisor
Sady_RifatCommunity AdvisorAccepted solution
Community Advisor
Oct 16, 2023 10:59 AM UTC

Since in your project, the log is pointing to error.log it actually did this->

  1. Your Project OSGI config prints the error log
  2. The default configuration `Apache Sling Logging Logger Configuration` also prints in the same file. See more-> https://experienceleague.adobe.com/docs/experience-manager-65/deploying/configuring/configure-logging.html?lang=en.
    You can find this default configuration in the OSGI config.
     
Translate
kautuk_sahni
Level 9
Oct 16, 2023 11:07 AM UTC

@shyamasundar-ks Did you find the suggestions from Sady helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Translate
Kautuk Sahni