Menu

Who owns appenders?

2003-04-10
2003-04-10
  • Lloyd Rahimisa

    Lloyd Rahimisa - 2003-04-10

    Hi,
    I found out that when calling 'removeAppender', log4cpp internally checks whether the category owns the appender. When does a category own an appender?
    For example: if I create one appender object
    log4cpp::RollingFileAppender* appender = new ....

    and add this appender to many categories

    category1.setAppender(appender);
    category2.setAppender(appender);
    category2.setAppender(appender);
            .
            .
            .
    which category actually owns the appender?

    Furthermore, when calling 'removeAppender', and the category actually owns the appender, the appender object is actually deleted. What happens if I want to log using a different category which was  assigned the same appender?

    I know it is a bit too much to ask at once, but I am (extensively ) using log4cpp for logging in a (very) big project and now I am stuck because I am getting Segmentation faults whenever I call 'removeAppender'.

    Can anyone help?
    Thanx already ('in advance', that is).
    lloyd 

     
    • Lloyd Rahimisa

      Lloyd Rahimisa - 2003-04-10

      Hi,
      its me again. I am using version 0.3.1, by the way (because I need the RollingFileAppender).
      lloyd

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.