You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Sajith Kariyawasam <sa...@wso2.com> on 2013/11/22 10:48:47 UTC

Logging messages twice in Stratos Controller log files

Hi all,

Found that some messages are logged twice in SC log files, and reason being
 there are some misconfiguration in log4j.properties file.

In current log4j.properties file we have following,

log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY
log4j.logger.org.apache=INFO, CARBON_LOGFILE, CARBON_MEMORY

which means, CARBON_LOGFILE appender is added (explicitly) to "org.apache"
logger, and also the same appender is inherited from the root logger, hence
"org.apache"  logger having two appenders, but both point to the same log
file.

removing CARBON_LOGFILE (and  CARBON_MEMORY) appenders from  "org.apache"
logger solve the problem.

Thanks
Sajith


-- 
*Sajith Kariyawasam*
*Senior Software Engineer; WSO2, Inc.*
*AMIE (SL)*
*Blog: http://sajithblogs.blogspot.com/ <http://sajithblogs.blogspot.com/>*
*Mobile: +94772269575*

Re: Logging messages twice in Stratos Controller log files

Posted by Imesh Gunaratne <im...@apache.org>.
Nice finding Sajith!!
Please update the below issues if you fix this:

https://issues.apache.org/jira/browse/STRATOS-186
https://issues.apache.org/jira/browse/STRATOS-187

Thanks


On Fri, Nov 22, 2013 at 5:48 PM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi Sajith,
>
> There are jiras created for this which are in resolved state since
> duplicate logs did not appear in released M2 AMI.
>
> Touched, not typed. Erroneous words are a feature, not a typo.
> On Nov 22, 2013 3:25 PM, "Lahiru Sandaruwan" <la...@wso2.com> wrote:
>
>> Me too have seen this. Also IIRC this was experienced in ELB or CC
>> sometime back. Can you kinly have a look on those log4j configs as well.
>>
>> Thanks.
>>
>>
>> On Fri, Nov 22, 2013 at 3:20 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>
>>> I've noticed the same, and thanks for investigating. Please commit the
>>> fix.
>>>
>>>
>>> On Fri, Nov 22, 2013 at 3:18 PM, Sajith Kariyawasam <sa...@wso2.com>wrote:
>>>
>>>> Hi all,
>>>>
>>>> Found that some messages are logged twice in SC log files, and reason
>>>> being  there are some misconfiguration in log4j.properties file.
>>>>
>>>> In current log4j.properties file we have following,
>>>>
>>>> log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY
>>>> log4j.logger.org.apache=INFO, CARBON_LOGFILE, CARBON_MEMORY
>>>>
>>>> which means, CARBON_LOGFILE appender is added (explicitly) to
>>>> "org.apache" logger, and also the same appender is inherited from the root
>>>> logger, hence "org.apache"  logger having two appenders, but both point to
>>>> the same log file.
>>>>
>>>> removing CARBON_LOGFILE (and  CARBON_MEMORY) appenders from
>>>>  "org.apache" logger solve the problem.
>>>>
>>>> Thanks
>>>> Sajith
>>>>
>>>>
>>>> --
>>>> *Sajith Kariyawasam*
>>>> *Senior Software Engineer; WSO2, Inc.*
>>>> *AMIE (SL)*
>>>> *Blog: http://sajithblogs.blogspot.com/
>>>> <http://sajithblogs.blogspot.com/>*
>>>> *Mobile: +94772269575 <%2B94772269575>*
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> --
>> Lahiru Sandaruwan
>> Software Engineer,
>> Platform Technologies,
>> WSO2 Inc., http://wso2.com
>> lean.enterprise.middleware
>>
>> email: lahirus@wso2.com cell: (+94) 773 325 954
>> blog: http://lahiruwrites.blogspot.com/
>> twitter: http://twitter.com/lahirus
>> linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146
>>
>>

Re: Logging messages twice in Stratos Controller log files

Posted by Udara Liyanage <ud...@wso2.com>.
Hi Sajith,

There are jiras created for this which are in resolved state since
duplicate logs did not appear in released M2 AMI.

Touched, not typed. Erroneous words are a feature, not a typo.
On Nov 22, 2013 3:25 PM, "Lahiru Sandaruwan" <la...@wso2.com> wrote:

> Me too have seen this. Also IIRC this was experienced in ELB or CC
> sometime back. Can you kinly have a look on those log4j configs as well.
>
> Thanks.
>
>
> On Fri, Nov 22, 2013 at 3:20 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> I've noticed the same, and thanks for investigating. Please commit the
>> fix.
>>
>>
>> On Fri, Nov 22, 2013 at 3:18 PM, Sajith Kariyawasam <sa...@wso2.com>wrote:
>>
>>> Hi all,
>>>
>>> Found that some messages are logged twice in SC log files, and reason
>>> being  there are some misconfiguration in log4j.properties file.
>>>
>>> In current log4j.properties file we have following,
>>>
>>> log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY
>>> log4j.logger.org.apache=INFO, CARBON_LOGFILE, CARBON_MEMORY
>>>
>>> which means, CARBON_LOGFILE appender is added (explicitly) to
>>> "org.apache" logger, and also the same appender is inherited from the root
>>> logger, hence "org.apache"  logger having two appenders, but both point to
>>> the same log file.
>>>
>>> removing CARBON_LOGFILE (and  CARBON_MEMORY) appenders from
>>>  "org.apache" logger solve the problem.
>>>
>>> Thanks
>>> Sajith
>>>
>>>
>>> --
>>> *Sajith Kariyawasam*
>>> *Senior Software Engineer; WSO2, Inc.*
>>> *AMIE (SL)*
>>> *Blog: http://sajithblogs.blogspot.com/
>>> <http://sajithblogs.blogspot.com/>*
>>> *Mobile: +94772269575 <%2B94772269575>*
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> --
> Lahiru Sandaruwan
> Software Engineer,
> Platform Technologies,
> WSO2 Inc., http://wso2.com
> lean.enterprise.middleware
>
> email: lahirus@wso2.com cell: (+94) 773 325 954
> blog: http://lahiruwrites.blogspot.com/
> twitter: http://twitter.com/lahirus
> linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146
>
>

Re: Logging messages twice in Stratos Controller log files

Posted by Sajith Kariyawasam <sa...@wso2.com>.
sure, will do.


On Fri, Nov 22, 2013 at 3:25 PM, Lahiru Sandaruwan <la...@wso2.com> wrote:

> Me too have seen this. Also IIRC this was experienced in ELB or CC
> sometime back. Can you kinly have a look on those log4j configs as well.
>
> Thanks.
>
>
> On Fri, Nov 22, 2013 at 3:20 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> I've noticed the same, and thanks for investigating. Please commit the
>> fix.
>>
>>
>> On Fri, Nov 22, 2013 at 3:18 PM, Sajith Kariyawasam <sa...@wso2.com>wrote:
>>
>>> Hi all,
>>>
>>> Found that some messages are logged twice in SC log files, and reason
>>> being  there are some misconfiguration in log4j.properties file.
>>>
>>> In current log4j.properties file we have following,
>>>
>>> log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY
>>> log4j.logger.org.apache=INFO, CARBON_LOGFILE, CARBON_MEMORY
>>>
>>> which means, CARBON_LOGFILE appender is added (explicitly) to
>>> "org.apache" logger, and also the same appender is inherited from the root
>>> logger, hence "org.apache"  logger having two appenders, but both point to
>>> the same log file.
>>>
>>> removing CARBON_LOGFILE (and  CARBON_MEMORY) appenders from
>>>  "org.apache" logger solve the problem.
>>>
>>> Thanks
>>> Sajith
>>>
>>>
>>> --
>>> *Sajith Kariyawasam*
>>> *Senior Software Engineer; WSO2, Inc.*
>>> *AMIE (SL)*
>>> *Blog: http://sajithblogs.blogspot.com/
>>> <http://sajithblogs.blogspot.com/>*
>>> *Mobile: +94772269575 <%2B94772269575>*
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> --
> Lahiru Sandaruwan
> Software Engineer,
> Platform Technologies,
> WSO2 Inc., http://wso2.com
> lean.enterprise.middleware
>
> email: lahirus@wso2.com cell: (+94) 773 325 954
> blog: http://lahiruwrites.blogspot.com/
> twitter: http://twitter.com/lahirus
> linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146
>
>


-- 
*Sajith Kariyawasam*
*Senior Software Engineer; WSO2, Inc.*
*AMIE (SL)*
*Blog: http://sajithblogs.blogspot.com/ <http://sajithblogs.blogspot.com/>*
*Mobile: +94772269575*

Re: Logging messages twice in Stratos Controller log files

Posted by Lahiru Sandaruwan <la...@wso2.com>.
Me too have seen this. Also IIRC this was experienced in ELB or CC sometime
back. Can you kinly have a look on those log4j configs as well.

Thanks.


On Fri, Nov 22, 2013 at 3:20 PM, Nirmal Fernando <ni...@gmail.com>wrote:

> I've noticed the same, and thanks for investigating. Please commit the fix.
>
>
> On Fri, Nov 22, 2013 at 3:18 PM, Sajith Kariyawasam <sa...@wso2.com>wrote:
>
>> Hi all,
>>
>> Found that some messages are logged twice in SC log files, and reason
>> being  there are some misconfiguration in log4j.properties file.
>>
>> In current log4j.properties file we have following,
>>
>> log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY
>> log4j.logger.org.apache=INFO, CARBON_LOGFILE, CARBON_MEMORY
>>
>> which means, CARBON_LOGFILE appender is added (explicitly) to
>> "org.apache" logger, and also the same appender is inherited from the root
>> logger, hence "org.apache"  logger having two appenders, but both point to
>> the same log file.
>>
>> removing CARBON_LOGFILE (and  CARBON_MEMORY) appenders from  "org.apache"
>> logger solve the problem.
>>
>> Thanks
>> Sajith
>>
>>
>> --
>> *Sajith Kariyawasam*
>> *Senior Software Engineer; WSO2, Inc.*
>> *AMIE (SL)*
>> *Blog: http://sajithblogs.blogspot.com/
>> <http://sajithblogs.blogspot.com/>*
>> *Mobile: +94772269575 <%2B94772269575>*
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
--
Lahiru Sandaruwan
Software Engineer,
Platform Technologies,
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

email: lahirus@wso2.com cell: (+94) 773 325 954
blog: http://lahiruwrites.blogspot.com/
twitter: http://twitter.com/lahirus
linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146

Re: Logging messages twice in Stratos Controller log files

Posted by Nirmal Fernando <ni...@gmail.com>.
I've noticed the same, and thanks for investigating. Please commit the fix.


On Fri, Nov 22, 2013 at 3:18 PM, Sajith Kariyawasam <sa...@wso2.com> wrote:

> Hi all,
>
> Found that some messages are logged twice in SC log files, and reason
> being  there are some misconfiguration in log4j.properties file.
>
> In current log4j.properties file we have following,
>
> log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY
> log4j.logger.org.apache=INFO, CARBON_LOGFILE, CARBON_MEMORY
>
> which means, CARBON_LOGFILE appender is added (explicitly) to "org.apache"
> logger, and also the same appender is inherited from the root logger, hence
> "org.apache"  logger having two appenders, but both point to the same log
> file.
>
> removing CARBON_LOGFILE (and  CARBON_MEMORY) appenders from  "org.apache"
> logger solve the problem.
>
> Thanks
> Sajith
>
>
> --
> *Sajith Kariyawasam*
> *Senior Software Engineer; WSO2, Inc.*
> *AMIE (SL)*
> *Blog: http://sajithblogs.blogspot.com/ <http://sajithblogs.blogspot.com/>*
> *Mobile: +94772269575 <%2B94772269575>*
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/