Disable logrotate/Log4j RollingFileAppender, creating a new log file at midnight while harvesting

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Disable logrotate/Log4j RollingFileAppender, creating a new log file at midnight while harvesting

Ob Rzwo
Hello, list,

if Geonetwork harvests beyond midnight or 00:00 UTC a new log file is
created. I would like to avoid that, so that logs concerning a harvesting
are in one file. Is it enough to rename from RollingFileAppender to
FileAppender? The file would be
/usr/local/tomcat/webapps/geonetwork/WEB-INF/classes/log4j-dev.xml? If not,
how? :)

Kind regards
Gregor
BKG

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Disable logrotate/Log4j RollingFileAppender, creating a new log file at midnight while harvesting

Jose Garcia
Hi

I see this code:
https://github.com/geonetwork/core-geonetwork/blob/b0fb96b5b7bd23da5956a99926d559f2a7967225/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java#L205

DailyRollingFileAppender fa = new DailyRollingFileAppender();

That is creating the log file for the harvester execution, but indeed if
the harvesting ends in the following day, should be creating a new file. As
each harvester log file gets a name that contains the start date of the
harvesting I think using FileAppender should fix the issue, no need to use
any rolling appender.

Can you open an issue in GitHub? A pull request is also welcome if you can
do it,

Thanks and regards,
Jose García


On Thu, Aug 13, 2020 at 4:00 PM Ob Rzwo <[hidden email]> wrote:

> Hello, list,
>
> if Geonetwork harvests beyond midnight or 00:00 UTC a new log file is
> created. I would like to avoid that, so that logs concerning a harvesting
> are in one file. Is it enough to rename from RollingFileAppender to
> FileAppender? The file would be
> /usr/local/tomcat/webapps/geonetwork/WEB-INF/classes/log4j-dev.xml? If not,
> how? :)
>
> Kind regards
> Gregor
> BKG
>
> _______________________________________________
> GeoNetwork-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>


--











*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/>Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664>Please consider the environment before printing
this email.*

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork