[ http://issues.apache.org/jira/browse/NUTCH-163?page=all ]
Daniel Feinstein updated NUTCH-163:
-----------------------------------
Attachment: LogFormatter.java
Here is the solution we have in RawSugar.com project
> LogFormatter design
> -------------------
>
> Key: NUTCH-163
> URL: http://issues.apache.org/jira/browse/NUTCH-163
> Project: Nutch
> Type: Improvement
> Environment: All platforms
> Reporter: Daniel Feinstein
> Attachments: LogFormatter.java
>
> In Nutch project LogFormatter has duplicated functionality:
> 1) Logger records format and
> 2) Severe error handler
>
> The first usage is standard and usually could be overwritten by a user of the
> package by modifying logging.properties file.
> The second usage is much more problematic because it affects the behavior of
> the whole application (not only Nutch package). To support the error handling
> LogFormatter enforce usage of the formatter class by all classes of the whole
> application which uses Nutch package. This is done by overwriting all the
> system handlers (class java.util.logging.Handler). This operation prevents
> the application to use its own log formatter. Also this cause
> LogFormatter.hasLoggedSevere() to be sensitive to all severe records in the
> big system but not only to relevant. More than that this flag,
> LogFormatter.loggedSevere is never cleaned what means if an application had
> one, even unrelated severe record, tools like Fetcher will never run until
> the application will be restarted.
>
> I would like to suggest the following solutions:
> 1) To separate the functionality of log formatting and error handling or
> 2) Change LogFormatter class to be affected only by nutch package functions
>
> For my opinion the first solution is much better especially if error handling
> will be encapsulated for each task. I have found the following usages of
> LogFormatter.hasLoggedSevere():
> - Fetcher
> - URLFilterChecker
> - ParseSegment
> Unfortunately I'm not familiar enough with the usages above to implement this
> solution that why I suggest the second one.
> I have rewritten my own implementation of LogFormatter class which is used
> for more than a year in www.rawsugar.com application.
> I could provide the file but do not know how to attach it to the issue. I
> hope this change will be accepted by the community.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira