You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Tim Allison (Jira)" <ji...@apache.org> on 2023/05/23 19:54:00 UTC

[jira] [Comment Edited] (TIKA-4050) Forked child logs are overwritten upon restart

    [ https://issues.apache.org/jira/browse/TIKA-4050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17725556#comment-17725556 ] 

Tim Allison edited comment on TIKA-4050 at 5/23/23 7:53 PM:
------------------------------------------------------------

I think the solution for this is to specify a log4j2.xml to be used by the forked processes.  Then you can configure log4j2 to not overwrite existing logs.

See: https://cwiki.apache.org/confluence/display/TIKA/TikaServer+in+Tika+2.x and specifically:

{noformat}
     <forkedJvmArgs>
        <arg>-Xms1g</arg>
        <arg>-Xmx1g</arg>
        <arg>-Dlog4j.configurationFile=my-forked-log4j2.xml</arg>
     </forkedJvmArgs>
{noformat}


was (Author: tallison@mitre.org):
I think the solution for this is to specify a log4j2.xml to be used by the forked processes.  Then you can configure log4j2 to not overwrite existing logs.

See: https://cwiki.apache.org/confluence/display/TIKA/TikaServer+in+Tika+2.x and specifically:

{noformat}}
     <forkedJvmArgs>
        <arg>-Xms1g</arg>
        <arg>-Xmx1g</arg>
        <arg>-Dlog4j.configurationFile=my-forked-log4j2.xml</arg>
     </forkedJvmArgs>
{noformat}

> Forked child logs are overwritten upon restart
> ----------------------------------------------
>
>                 Key: TIKA-4050
>                 URL: https://issues.apache.org/jira/browse/TIKA-4050
>             Project: Tika
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.8.0
>         Environment: Windows 10 Enterprise
>            Reporter: Josh Burchard
>            Priority: Major
>         Attachments: dtikacfg.xml, log4jTika.xml
>
>
> In my config file I specify a log file path for the forked child to use.  A problem arises when the child has a problem and the watchdog restarts it because the new child overwrites the previous child's log so I lose the details about what the child was doing prior to a restart.  Requesting that logging is preserved for all children while the watchdog is resident.
>  
> Reproduction steps:
> [^dtikacfg.xml] [^log4jTika.xml]
>  # ^Launch tika server:^
> ^java.exe -Djt="c:\tikatmp0000" -Dll="c:\tika0000.log" -Dcf="c:\log4jTika.xml" -jar "c:\tika-server-standard-2.8.0.jar" -c "c:\dtikacfg.xml"^
>  # ^Peek at the tika0000.log file and take note of the timestamps.^
>  # ^Kill the Tika child task and allow the watchdog to restart it.^
>  # ^Note that the previous content has been overwritten by log lines with new timestamps.^
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)