Re: Clearing All Loggers from the Logger Repository.

2014-04-01 Thread Thorsten Schöning
Guten Tag Nandan S,
am Dienstag, 1. April 2014 um 17:09 schrieben Sie:

> does log4cxx have a direct function like repo->deleteLogger(). ...

Doesn't look like and anyways I would think this is somewhat complex
to achieve. How should callers with to be deleted loggers deal with
this situation or the non working but still aquired loggers themselfs?

> 2) Suppose if i update the "customLogger3" to "customLogger4" while logging
> in progress, Why is it not updating the Logger Repository to have only

How do you update a logger? I can't see any suitable method.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail:thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow



Re: Clearing All Loggers from the Logger Repository.

2014-04-09 Thread Alexandru Zbarcea
Hi Nandan,

I think I understand what you want to achieve.

Can you setup-up an example project to understand and test better? I think
your request would translate better into some feature request.

Regards,
Alex


Re: Clearing All Loggers from the Logger Repository.

2014-04-09 Thread Nandan S
Hi Alex,
Our software is based on software component architecture and each
component will have it's own logger along with default root logger. If the
logger with component name exists, it uses the component logger for logging
and if it does not exist, then the component will use root logger. 

When my software is running, i delete one of the logger's. Software
reloads the configuration file periodically.  After the component logger is
deleted, the component should use default root logger. But the repository
will return the deleted logger also which is incorrect which causes software
to behave incorrectly.

   In any case, if the configuration file is reloaded, why should the
repository contain the deleted loggers ?. I feel this is somewhat incorrect.

I hope the use case is clear now.

Regards,
Nandan



--
View this message in context: 
http://apache-logging.6191.n7.nabble.com/Clearing-All-Loggers-from-the-Logger-Repository-tp45835p46080.html
Sent from the Log4cxx - Users mailing list archive at Nabble.com.


Re: Clearing All Loggers from the Logger Repository.

2014-04-10 Thread Thorsten Schöning
Guten Tag Nandan S,
am Donnerstag, 10. April 2014 um 07:02 schrieben Sie:

> When my software is running, i delete one of the logger's.

You still didn't explain how exactly you are doing that because there
don't seem to be an API do delete loggers.

>In any case, if the configuration file is reloaded, why should the
> repository contain the deleted loggers ?. I feel this is somewhat incorrect.

This depends on how or if at all you deleted the loggers and if they
are still configured in the file etc. From your explanation those
questions are not clearly answered to me.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail:thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow



Re: Clearing All Loggers from the Logger Repository.

2014-04-10 Thread Nandan S
>> When my software is running, i delete one of the logger's. 

>You still didn't explain how exactly you are doing that because there 
>don't seem to be an API do delete loggers.

  Loggers will be deleted/added from configuration file manually.
Changes configuration will be used only  after application is restarted. But
restarting application is pain and is not advisable.

>>In any case, if the configuration file is reloaded, why should the 
>> repository contain the deleted loggers ?. I feel this is somewhat
>> incorrect. 

>This depends on how or if at all you deleted the loggers and if they 
>are still configured in the file etc. From your explanation those 
>questions are not clearly answered to me. 
  
  My application periodically reloads the configuration file and
populates the repository again. When the repository is populated again by
reloading the configuration file, old loggers which were deleted from
configuration file are still present in repository. 

 I hope this makes it more clearer.




--
View this message in context: 
http://apache-logging.6191.n7.nabble.com/Clearing-All-Loggers-from-the-Logger-Repository-tp45835p46092.html
Sent from the Log4cxx - Users mailing list archive at Nabble.com.


Re: Clearing All Loggers from the Logger Repository.

2014-04-10 Thread Thorsten Schöning
Guten Tag Nandan S,
am Donnerstag, 10. April 2014 um 10:43 schrieben Sie:

>   Loggers will be deleted/added from configuration file manually.

And that's the point: There's no logic or API to delete loggers and
during reloading a configuration file the repository is not
automatically reset, which means changes are only added or existing
objects reconfigured. Deleted loggers are not recognized as such and
stay in the repo.

The only option you seem to have is to do as I said before: Override
the used file watcher and reset the repo on your own. This way each
reload of the configuration file starts newly from scratch.

I'm pretty sure there won't be any other solution in the near future,
because there are too many open questions to answer: One needs to
recognize deleted objects from the configuration and delete those from
the repository, but they might still be in use somewhere around 
an application etc. This doesn't sound like an easy task.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail:thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow



Re: Clearing All Loggers from the Logger Repository.

2014-04-10 Thread Alexandru Zbarcea
Hi,

> And that's the point: There's no logic or API to delete loggers and
> during reloading a configuration file the repository is not
> automatically reset, which means changes are only added or existing
> objects reconfigured. Deleted loggers are not recognized as such and
> stay in the repo.

Log4j has the:
log4j.appender.example.MaxFileSize=500KB
log4j.appender.example.MaxBackupIndex=10

(xml file should be ~ the same)

I know this was in plan to implement of not already. This is the proper way
to keep the logs small. Do not delete them manually if you do not want to
restart the app.

>
> The only option you seem to have is to do as I said before: Override
> the used file watcher and reset the repo on your own. This way each
> reload of the configuration file starts newly from scratch.

You also have DailyRollingFileAppender to start a new file each day (read
the manual).

To start a new file each restart you have:


If these don't work, there is a bug.

Regards,
Alex


Re: Clearing All Loggers from the Logger Repository.

2014-04-10 Thread Thorsten Schöning
Guten Tag Alexandru Zbarcea,
am Donnerstag, 10. April 2014 um 23:04 schrieben Sie:

>  Log4j has the:
> log4j.appender.example.MaxFileSize=500KB
> log4j.appender.example.MaxBackupIndex=10
>  (xml file should be ~ the same)
>  I know this was in plan to implement of not already. This is the
> proper way to keep the logs small. Do not delete them manually if
> you do not want to restart the app.

One of us misunderstands his problem: I don't think it's about log
file sizes, but changes in the log configuration itself on file level
and how or if at all they are reflected if a file watcher is used. And
some changes, like deleted loggers, are simply not recognized as such
because it's a complex topic to do so.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail:thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow



Re: Clearing All Loggers from the Logger Repository.

2014-04-11 Thread Alexandru Zbarcea
You are right Thorsten,

It is not easy. But the question remains, is it an acceptable  feature
request? If yes, ye can create a ticket, and we'll see when it will be
implemented.

To remove the logger completely he can not. But he can reduce the size to
10K and max backup to 1.

Regards,
Alex
Guten Tag Alexandru Zbarcea,
am Donnerstag, 10. April 2014 um 23:04 schrieben Sie:

>  Log4j has the:
> log4j.appender.example.MaxFileSize=500KB
> log4j.appender.example.MaxBackupIndex=10
>  (xml file should be ~ the same)
>  I know this was in plan to implement of not already. This is the
> proper way to keep the logs small. Do not delete them manually if
> you do not want to restart the app.

One of us misunderstands his problem: I don't think it's about log
file sizes, but changes in the log configuration itself on file level
and how or if at all they are reflected if a file watcher is used. And
some changes, like deleted loggers, are simply not recognized as such
because it's a complex topic to do so.

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning   E-Mail:thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Clearing All Loggers from the Logger Repository.

2014-04-11 Thread Thorsten Schöning
Guten Tag Alexandru Zbarcea,
am Freitag, 11. April 2014 um 14:32 schrieben Sie:

>  It is not easy. But the question remains, is it an acceptable 
> feature request? If yes, ye can create a ticket, and we'll see when it will 
> be implemented.

From my point of view what he wants can be achieved by implementing
callbacks for the filewatcher, this should be more easy to implement
than removing single loggers alone.

https://issues.apache.org/jira/browse/LOGCXX-429

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail:thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow



Re: Clearing All Loggers from the Logger Repository.

2014-04-11 Thread Alexandru Zbarcea
Fair enough
+1

Alex
On Apr 11, 2014 8:56 AM, "Thorsten Schöning"  wrote:

Guten Tag Alexandru Zbarcea,
am Freitag, 11. April 2014 um 14:32 schrieben Sie:

>  It is not easy. But the question remains, is it an acceptable
> feature request? If yes, ye can create a ticket, and we'll see when it
will be implemented.

>From my point of view what he wants can be achieved by implementing
callbacks for the filewatcher, this should be more easy to implement
than removing single loggers alone.

https://issues.apache.org/jira/browse/LOGCXX-429

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning   E-Mail:thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow