[Dev] Is it recommended to have two log4j properties files in one MB pack?
Hi, Currently, WSO2 MB supports both Cassandra and Zookeeper profiles. The log4j.properties file is configured to write all Cassandra related logs to cassandra_system.log and all zookeeper related logs to zookeeper.log. We came up to a requirement where, we need to append all Cassandra logs also to wso2carbon.log only when, the MB is started in Cassandra profile. Refer [1] As I see, this can be get done only by maintaining two log4j properties files with different configurations to be used in different profiles. Is it recommended to have two log4j properties files in one MB pack? Else do you have any other solution for this? [1] https://wso2.org/jira/browse/MB-671 Thanks -- Sewwandi Perera Software Engineer WSO2 Inc.; http://wso2.com lean.enterprise.middleware ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Is it recommended to have two log4j properties files in one MB pack?
On Thu, May 22, 2014 at 5:06 PM, Sewwandi Perera sewwa...@wso2.com wrote: Hi, Currently, WSO2 MB supports both Cassandra and Zookeeper profiles. The log4j.properties file is configured to write all Cassandra related logs to cassandra_system.log and all zookeeper related logs to zookeeper.log. So these separate log files are used only when those profiles started? We came up to a requirement where, we need to append all Cassandra logs also to wso2carbon.log only when, the MB is started in Cassandra profile. Refer [1] I'm sorry, I did not get this requirement. You want to have cassandra related logs on a separate log file. I believe this is to make the cassandra log analyzing easy. So what is the purpose of again using carbon log file for that? As I see, this can be get done only by maintaining two log4j properties files with different configurations to be used in different profiles. Is it recommended to have two log4j properties files in one MB pack? Else do you have any other solution for this? [1] https://wso2.org/jira/browse/MB-671 Thanks -- Sewwandi Perera Software Engineer WSO2 Inc.; http://wso2.com lean.enterprise.middleware -- *Kishanthan Thangarajah* Senior Software Engineer, Platform Technologies Team, WSO2, Inc. lean.enterprise.middleware Mobile - +94773426635 Blog - *http://kishanthan.wordpress.com http://kishanthan.wordpress.com* Twitter - *http://twitter.com/kishanthan http://twitter.com/kishanthan* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Is it recommended to have two log4j properties files in one MB pack?
Hi Kishanthan, On Thu, May 22, 2014 at 10:41 PM, Kishanthan Thangarajah kishant...@wso2.com wrote: On Thu, May 22, 2014 at 5:06 PM, Sewwandi Perera sewwa...@wso2.comwrote: Hi, Currently, WSO2 MB supports both Cassandra and Zookeeper profiles. The log4j.properties file is configured to write all Cassandra related logs to cassandra_system.log and all zookeeper related logs to zookeeper.log. So these separate log files are used only when those profiles started? We came up to a requirement where, we need to append all Cassandra logs also to wso2carbon.log only when, the MB is started in Cassandra profile. Refer [1] I'm sorry, I did not get this requirement. You want to have cassandra related logs on a separate log file. I believe this is to make the cassandra log analyzing easy. So what is the purpose of again using carbon log file for that? The exact requirement is, since now we start Cassandra with mb profiles it starts as an MB instance where in general users tends to monitor the wso2carbon log and terminal log. However since the Cassandra related logs get appended to a separate file, in case of Cassandra failure, the user doesn't see any error logs etc. in wso2carbon log or in terminal logs where Cassandra profile is running. Hence from users' perspective i think it is required to append the cassandra (or zookeeper) logs into wso2carbon.log file only when MB instance is started as a Cassandra or a Zookeeper server. If we append these to root logger of default log4j.properties file the logs will be displayed in non-profiled MB servers as well. That is why it is required to keep two log4j.properties files. Thanks! Ishara As I see, this can be get done only by maintaining two log4j properties files with different configurations to be used in different profiles. Is it recommended to have two log4j properties files in one MB pack? Else do you have any other solution for this? [1] https://wso2.org/jira/browse/MB-671 Thanks -- Sewwandi Perera Software Engineer WSO2 Inc.; http://wso2.com lean.enterprise.middleware -- *Kishanthan Thangarajah* Senior Software Engineer, Platform Technologies Team, WSO2, Inc. lean.enterprise.middleware Mobile - +94773426635 Blog - *http://kishanthan.wordpress.com http://kishanthan.wordpress.com* Twitter - *http://twitter.com/kishanthan http://twitter.com/kishanthan* -- Ishara Premasada Software Engineer, WSO2 Inc. http://wso2.com/ *Blog : http://isharapremadasa.blogspot.com/ http://isharapremadasa.blogspot.com/Twitter : https://twitter.com/ishadil https://twitter.com/ishadilMobile : +94 714445832* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Is it recommended to have two log4j properties files in one MB pack?
Hi All, What unclear point here is how to use two log4j.properties files in same pack. Because even if you started any carbon related server with profiles means it's starting the same pack with same configuration files. Only difference is features which are activating at the runtime is different. In the build time we copy log4j.properties file to repository/conf folder. So if you want to use the two log4j.properties files where are you going to keep those 2 files and how are you going to specifically tell to the carbon server to use this file when start with this profile? I think this would be code changes in the carbon level and cannot do because this is a specific requirement to MB. What can do is at the runtime copy different log4j.properties file to the above location using the wso2server.sh file keeping those in the different location. I think this is not an elegant way to achieve this. But can't we achieve this using the same log4j.properties file ? I think we can combine all the appenders to the same log4j.properties file. Even MB started with profile or standard alone mode, in each time cassandra or zookeeper features activated. So it would be helpful users to see the logs in both ways. Cheers! On Fri, May 23, 2014 at 12:47 AM, Ishara Premadasa ish...@wso2.com wrote: Hi Kishanthan, On Thu, May 22, 2014 at 10:41 PM, Kishanthan Thangarajah kishant...@wso2.com wrote: On Thu, May 22, 2014 at 5:06 PM, Sewwandi Perera sewwa...@wso2.comwrote: Hi, Currently, WSO2 MB supports both Cassandra and Zookeeper profiles. The log4j.properties file is configured to write all Cassandra related logs to cassandra_system.log and all zookeeper related logs to zookeeper.log. So these separate log files are used only when those profiles started? We came up to a requirement where, we need to append all Cassandra logs also to wso2carbon.log only when, the MB is started in Cassandra profile. Refer [1] I'm sorry, I did not get this requirement. You want to have cassandra related logs on a separate log file. I believe this is to make the cassandra log analyzing easy. So what is the purpose of again using carbon log file for that? The exact requirement is, since now we start Cassandra with mb profiles it starts as an MB instance where in general users tends to monitor the wso2carbon log and terminal log. However since the Cassandra related logs get appended to a separate file, in case of Cassandra failure, the user doesn't see any error logs etc. in wso2carbon log or in terminal logs where Cassandra profile is running. Hence from users' perspective i think it is required to append the cassandra (or zookeeper) logs into wso2carbon.log file only when MB instance is started as a Cassandra or a Zookeeper server. If we append these to root logger of default log4j.properties file the logs will be displayed in non-profiled MB servers as well. That is why it is required to keep two log4j.properties files. Thanks! Ishara As I see, this can be get done only by maintaining two log4j properties files with different configurations to be used in different profiles. Is it recommended to have two log4j properties files in one MB pack? Else do you have any other solution for this? [1] https://wso2.org/jira/browse/MB-671 Thanks -- Sewwandi Perera Software Engineer WSO2 Inc.; http://wso2.com lean.enterprise.middleware -- *Kishanthan Thangarajah* Senior Software Engineer, Platform Technologies Team, WSO2, Inc. lean.enterprise.middleware Mobile - +94773426635 Blog - *http://kishanthan.wordpress.com http://kishanthan.wordpress.com* Twitter - *http://twitter.com/kishanthan http://twitter.com/kishanthan* -- Ishara Premasada Software Engineer, WSO2 Inc. http://wso2.com/ *Blog : http://isharapremadasa.blogspot.com/ http://isharapremadasa.blogspot.com/Twitter : https://twitter.com/ishadil https://twitter.com/ishadil Mobile : +94 714445832 %2B94%20714445832* -- Indika Sampath Software Engineer WSO2 Inc. http://wso2.com Phone: +94 716 424 744 Blog: http://indikasampath.blogspot.com/ ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev