Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2F2F9200CC6 for ; Tue, 18 Jul 2017 14:53:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2D9C9166C6B; Tue, 18 Jul 2017 12:53:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 250B6166C6A for ; Tue, 18 Jul 2017 14:53:46 +0200 (CEST) Received: (qmail 74110 invoked by uid 500); 18 Jul 2017 12:53:46 -0000 Mailing-List: contact users-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@nifi.apache.org Delivered-To: mailing list users@nifi.apache.org Received: (qmail 74100 invoked by uid 99); 18 Jul 2017 12:53:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jul 2017 12:53:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 9F297C0360 for ; Tue, 18 Jul 2017 12:53:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.401 X-Spam-Level: X-Spam-Status: No, score=-0.401 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id c_b3klD-HOo5 for ; Tue, 18 Jul 2017 12:53:44 +0000 (UTC) Received: from mail-ua0-f172.google.com (mail-ua0-f172.google.com [209.85.217.172]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 3329E5F30C for ; Tue, 18 Jul 2017 12:53:39 +0000 (UTC) Received: by mail-ua0-f172.google.com with SMTP id y47so6671114uag.0 for ; Tue, 18 Jul 2017 05:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=J3q5xm5wiZT0sY6qUTVif1J+VXPvxqoSpycYNqfM3fg=; b=jVbJtsMkfq9MNpSi/Gno6YOUroPtG8qkH0iSg6LVlbSBAVpON9/d6ClsCbZfCUYZN5 65X7g3Qe5VpViFWPY04XBDzNp/pJs/e7w6qSsR9qgG9qZX6nhh8EjlrsUdKFo/cGQ6VP fnvglsDyRjwh0TNKjgsSpo9hh7Sac/YsGFBh2wMXYAIb2WcbtG1sLHUHOqKAUJ4aY7Z4 52euCTxHeU+F/z8I9QKFkHuxPyTnRZNHTdhmQ0axJaNpdq+QXfTi5Y9qvbB7WujcXtxc /3dMQ2YTNWR9XRbx8/hiRyrmMHhKBfd80pfxkBdcXgkApQCwJ2eVxs9NQy7ZoiO1VGR8 iV3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=J3q5xm5wiZT0sY6qUTVif1J+VXPvxqoSpycYNqfM3fg=; b=es1WnxpPbP98XhDkYayXhEjJTRCF1v+BrMcyRDB1AQBKYTK7DUYIE7MSRj7IgXUIEj XV1xDqcgvGL/TX+g985AXRkjdPmNkRxTAFArXn/60vmw3CG84MbDOqryhxzq7eipHzVK LlFD28DbQoFkSq9lUxsBFtFBwSZEgH7657QhCMBZPSk4URhXX+1IpSUlDf9stTonKOC/ jRTVCGgv3NQJ/q5L2sMyiFcvhUEsSnLqe+uuTvFo4uhnq6HhTlYlLBnw3xKsgv0uNNx6 OQZ+YbxxRqnMvq3OV61yFCU7hjTrbeizWggZj8JWO7CCTES7fZakcHEgAkmea7xEOe/4 f4oA== X-Gm-Message-State: AIVw1104BJ94TBU2563GNDWqoPHu+dHwH7kMvkIm3rmpOgpQ7Y1i9N7V usaWalkeJVyAavuwJqWATfMbw5cbbH7W0o0= X-Received: by 10.176.66.34 with SMTP id i31mr833365uai.11.1500382418271; Tue, 18 Jul 2017 05:53:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.35.85 with HTTP; Tue, 18 Jul 2017 05:52:57 -0700 (PDT) In-Reply-To: References: From: Aldrin Piri Date: Tue, 18 Jul 2017 08:52:57 -0400 Message-ID: Subject: Re: MaxHistoryNot Worked in logback-1.2.3? To: users@nifi.apache.org Content-Type: multipart/alternative; boundary="94eb2c0886061185820554970105" archived-at: Tue, 18 Jul 2017 12:53:48 -0000 --94eb2c0886061185820554970105 Content-Type: text/plain; charset="UTF-8" I think the comment in the config XML may be a bit misleading. Looking through the docs, it appears your configuration would keep 2 days of log files given your filename format leading to daily logs. Your max size of 100kB will cause rollover, incrementing the value represented by %i. With this configuration, I would expect no more than two unique days of data, but an unbounded number of 100kB incremental logs for each of those two days. Doing some searching it seems to be a recurring problem with some bugginess [2], but seems like you may want to evaluate the totalSizeCap [3] to lock down the overall size. [1] https://logback.qos.ch/manual/appenders.html#tbrpMaxHistory [2] https://jira.qos.ch/browse/LOGBACK-747 [3] https://logback.qos.ch/manual/appenders.html#tbrpTotalSizeCap On Mon, Jul 17, 2017 at 5:28 AM, prabhu Mahendran wrote: > I have tried below code to write logs based on SizeAndTimeBasedRollingPoli > cy. > > In that i can able to write files with respect to file size 100KB but not > able to maintain only 2 maxHistory files.It always write new file after > 100KB successfully written. > > Now i have using NiFI-1.3.0 which having logback version 1.2.3 for core > and classic jars. > > > > > > > ${org.apache.nifi.bootstrap.config.log.dir} > /nifi-app_%d{yyyy-MM-dd}.%i.log > > 100 KB > > > > 2 > > true > > > > > > > > %date %level [%thread] %logger{40} %msg%n > > > > > > > > I have faced like issue that may belongs to below task. > > https://jira.qos.ch/browse/LOGBACK-162 > > I have used NiFi-1.3.0 it only uses logback 1.2.3. > > In NiFi i have found one jira for upgrade logback. > > https://issues.apache.org/jira/browse/NIFI-3699 > > I think logback latest version is 1.2.3. Here it seems MaxHistory property > doesn't work. > > Am i missing anythink? > > Can anyone suggest me to solve this? > --94eb2c0886061185820554970105 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think the comment in the config XML may be a bit mislead= ing.=C2=A0 Looking through the docs, it appears your configuration would ke= ep 2 days of log files given your filename format leading to daily logs.
Your max size of 100kB will cause rollover, incrementing t= he value represented by %i.=C2=A0 With this configuration, I would expect n= o more than two unique days of data, but an unbounded number of 100kB incre= mental logs for each of those two days.

Doing some= searching it seems to be a recurring problem with some bugginess [2], but = seems like you may want to evaluate the totalSizeCap [3] to lock down the o= verall size.



<= br>
On Mon, Jul 17, 2017 at 5:28 AM, prabhu Mahen= dran <prabhuu161994@gmail.com> wrote:

I ha= ve tried below code to write logs based on=C2=A0SizeAndTimeBasedRollingPolicy.

In that i can able to write files with respect to file size 100K= B but not able to maintain only 2 maxHistory files.It always write new file= after 100KB successfully written.

N= ow i have using NiFI-1.3.0 which having logback version 1.2.3 for core and = classic jars.


<= span style=3D"font-size:15px"><appender name=3D"APP_FILE" clas= s=3D"ch.qos.logback.core.rolling.RollingFileAppender">

=C2=A0 =C2=A0 = =C2=A0 =C2=A0 <rollingPolicy class=3D"ch.qos.logback.core.roll= ing.SizeAndTimeBasedRollingPolicy">

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = <fileNamePattern>${org.apache.nifi.bootstrap.config.log.dir}/nifi-app_%d{yyyy-MM-dd}.%i.log</fileNamePattern>=

=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 <maxFileSize>100 KB</maxFileSize><= /p>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 <!-- keep 30 log files worth of history -->

=C2=A0 =C2=A0<maxHistory>2</maxHistory>

=C2=A0 =C2=A0<historyAsFileCount>true<= /historyAsFileCount>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0

=C2=A0 =C2=A0 =C2=A0 =C2=A0 </rollin= gPolicy>

= =C2=A0 =C2=A0 =C2=A0 =C2=A0 <encoder class=3D"ch.qos.logback.classi= c.encoder.PatternLayoutEncoder">

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &= lt;pattern>%date %level [%thread] %logger{40} %msg%n</pattern>

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 </encoder>

=C2=A0 =C2=A0 </appender>



I have faced like issue that may belongs to below task.<= /p>

https://jira.qos.ch/browse/LOGBACK-162

I have used NiFi-1.3.0 it only uses logback 1.2= .3.

In NiFi i have found one jira fo= r upgrade logback.

https://issues.apache.org/ji= ra/browse/NIFI-3699

I think logb= ack latest version is 1.2.3. Here it seems MaxHistory property doesn't = work.

Am i missing anythink?

Can anyone suggest me to solve t= his?


--94eb2c0886061185820554970105--