You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by John Smith <ja...@gmail.com> on 2021/04/27 07:46:20 UTC

Log rollover for logs.

Hi, I'm running flink as a systemd service with...

[Service]
Type=forking
WorkingDirectory=/opt/flink
User=flink
Group=flink
ExecStart=/opt/flink/bin/taskmanager.sh start
ExecStop=/opt/flink/bin/taskmanager.sh stop
TimeoutSec=30
Restart=on-failure

My log4j.porperties file is at /opt/flink/conf

Is it as simple as just setting the log rollover in there? Cause sometimes
with certain services like zookeeper some env variable overrides etc... So
just wondering if it's that straight forward with flink.

Re: Log rollover for logs.

Posted by Nicolaus Weidner <ni...@data-artisans.com>.
Hi John,

On Tue, Apr 27, 2021 at 9:47 AM John Smith <ja...@gmail.com> wrote:

> Hi, I'm running flink as a systemd service with...
>
> [Service]
> Type=forking
> WorkingDirectory=/opt/flink
> User=flink
> Group=flink
> ExecStart=/opt/flink/bin/taskmanager.sh start
> ExecStop=/opt/flink/bin/taskmanager.sh stop
> TimeoutSec=30
> Restart=on-failure
>
> My log4j.porperties file is at /opt/flink/conf
>
> Is it as simple as just setting the log rollover in there? Cause sometimes
> with certain services like zookeeper some env variable overrides etc... So
> just wondering if it's that straight forward with flink.
>

yes, you can use the log4j RollingFileAppender [1] for this purpose. You
can also find more information regarding logging in Flink in the docs [2].

Best regards,
Nico

[1]
https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender
[2]
https://ci.apache.org/projects/flink/flink-docs-stable/deployment/advanced/logging.html