Hi Isha,

You’re right, I wasn’t aware of this rollingPolicy and the supported patterns 
for it.
After reading logback documentation, it looks %i is mandatory with %d when 
using SizeAndTimeBaseRollingPolicy.

Thanks for pointing me there!
Regards

Emmanuel
C2 - Restricted

De : Isha Lamboo <[email protected]>
Envoyé : mardi 18 janvier 2022 11:40
À : [email protected]
Objet : RE: nifi-app log rotation

Hi Emmanuel,

The filename pattern needs to match with the rolling policy. You omitted that 
line in your snippet, but by default, the nifi-app looks like this:
<rollingPolicy 
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">

SizeAndTimeBased means you have to use both %d (time) and %i (size). If you 
only want to use one of those, change the policy to TimeBased or SizeBased.

In your example, you left out the %i, so it will be invalid for the default 
policy. Change the policy to TimeBasedRollingPolicy (like the user file has) to 
make it work.
You can also add “debug=true” to the <configuration scan="true" scanPeriod="30 
seconds"> tag, but that only takes effect if you submit a valid configuration, 
so you may need to revert to the original one first. With debug on, you’ll find 
more feedback in the logfile.

Regards,

Isha

Van: QUEVILLON EMMANUEL - EXT-SAFRAN ENGINEERING SERVICES (SAFRAN) 
<[email protected]<mailto:[email protected]>>
Verzonden: dinsdag 18 januari 2022 10:54
Aan: [email protected]<mailto:[email protected]>
Onderwerp: nifi-app log rotation

Hi guys,

I’m trying to configure the nifi-app.log rotation process by decreasing the 
rotation time and compressing the final rotated file.
To do this, I’ve updated ‘conf/logback.xml’ file by this default configuration:

    <appender name="APP_FILE" 
class="ch.qos.logback.core.rolling.RollingFileAppender">
           …
            
<fileNamePattern>${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
            …
    </appender>

To this one

    <appender name="APP_FILE" 
class="ch.qos.logback.core.rolling.RollingFileAppender">
            …
            
<fileNamePattern>${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d.log.gz</fileNamePattern>
           …
    </appender>

However, since I’ve updated `conf/logback.xml`, nifi-appl.log is not updated 
anymore and not new file is created.
I’ve tried different patterns and the following are working ok (log append to 
nifi-app.log):

1. 'nifi-app_%d.%i.log.gz'
2. 'nifi-app_%d{yyyy-MM-dd_HH}.%i.log.gz'

But either 'nifi-app_%d{yyyy-MM-dd_HH}.log.gz' nor nifi-app_%d.log.gz are 
working.

It there a reason for that? Sounds like the ‘%i’ in the fileNamePattern is 
required, whereas it is not the case for ‘nifi-user.log’ for example, this 
configuration ‘nifi-app_%d.log.gz’ is working ok, logs are appended into 
‘nifi-user.log’

Thanks for any help

Emmanuel
C2 - Restricted

#
" Ce courriel et les documents qui lui sont joints peuvent contenir des 
informations confidentielles, être soumis aux règlementations relatives au 
contrôle des exportations ou ayant un caractère privé. S'ils ne vous sont pas 
destinés, nous vous signalons qu'il est strictement interdit de les divulguer, 
de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. 
Toute exportation ou réexportation non autorisée est interdite Si ce message 
vous a été transmis par erreur, merci d'en informer l'expéditeur et de 
supprimer immédiatement de votre système informatique ce courriel ainsi que 
tous les documents qui y sont attachés."
******
" This e-mail and any attached documents may contain confidential or 
proprietary information and may be subject to export control laws and 
regulations. If you are not the intended recipient, you are notified that any 
dissemination, copying of this e-mail and any attachments thereto or use of 
their contents by any means whatsoever is strictly prohibited. Unauthorized 
export or re-export is prohibited. If you have received this e-mail in error, 
please advise the sender immediately and delete this e-mail and all attached 
documents from your computer system."
#

#
" Ce courriel et les documents qui lui sont joints peuvent contenir des 
informations confidentielles, être soumis aux règlementations relatives au 
contrôle des exportations ou ayant un caractère privé. S'ils ne vous sont pas 
destinés, nous vous signalons qu'il est strictement interdit de les divulguer, 
de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. 
Toute exportation ou réexportation non autorisée est interdite Si ce message 
vous a été transmis par erreur, merci d'en informer l'expéditeur et de 
supprimer immédiatement de votre système informatique ce courriel ainsi que 
tous les documents qui y sont attachés."
******
" This e-mail and any attached documents may contain confidential or 
proprietary information and may be subject to export control laws and 
regulations. If you are not the intended recipient, you are notified that any 
dissemination, copying of this e-mail and any attachments thereto or use of 
their contents by any means whatsoever is strictly prohibited. Unauthorized 
export or re-export is prohibited. If you have received this e-mail in error, 
please advise the sender immediately and delete this e-mail and all attached 
documents from your computer system."
#
  • nifi-app log... QUEVILLON EMMANUEL - EXT-SAFRAN ENGINEERING SERVICES (SAFRAN)
    • Re: nif... Juan Pablo Gardella
      • RE:... QUEVILLON EMMANUEL - EXT-SAFRAN ENGINEERING SERVICES (SAFRAN)
    • RE: nif... Isha Lamboo
      • RE:... QUEVILLON EMMANUEL - EXT-SAFRAN ENGINEERING SERVICES (SAFRAN)

Reply via email to