From nobody Mon Jul 17 16:01:56 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Rff0kp5z4ndCt for ; Mon, 17 Jul 2023 16:02:02 +0000 (UTC) (envelope-from robert@webtent.org) Received: from mx3.webtent.net (mx3.webtent.net [208.38.145.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Rfd4jjvz42Rt for ; Mon, 17 Jul 2023 16:02:01 +0000 (UTC) (envelope-from robert@webtent.org) Authentication-Results: mx1.freebsd.org; none Received: from localhost (localhost [127.0.0.1]) by mx3.webtent.net (WebTent ESMTP Postfix Internet Mail Exchange) with ESMTP id 73711D7B37; Mon, 17 Jul 2023 12:01:59 -0400 (EDT) Received: from mx3.webtent.net ([127.0.0.1]) by localhost (mx3.webtent.net [127.0.0.1]) (maiad, port 10024) with ESMTP id 98508-09; Mon, 17 Jul 2023 12:01:58 -0400 (EDT) Received: from [192.168.1.50] (ns2.webtent.net [144.129.73.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: robert@mx3.webtent.net) by mx3.webtent.net (WebTent ESMTP Postfix Internet Mail Exchange) with ESMTPSA id 9814AD7B1E; Mon, 17 Jul 2023 12:01:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=webtent.org; s=201611; t=1689609718; bh=h6qjAkuTPD9hr0g6RIv9LwvRwR/Ma37qsQ1Xy9JvotM=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=GrJ8Z4jdoGTREzzFPRnoBBTn2CGz1fdmgMXBleN1pbvvDLRR6NcSP13ZDAgrxSz+5 y7MQLLci9B384FuAMJfi4npQlkhF2FPu73baLZO6854874fM+gTCxZfMyKTSJId3n0 ZnlNoexrWUN7J6KUaqE9WABSbR+s4WTLUkOGu+6y48mmwhic45vjSbcweHH0sj5jsu U2CEx1ouLHjuoxlhYzYaOI0kLnqdVrHRyau/SInr3kv5LGruC5+c+8mnIJ1X5/arBc RPKUB+dxVOJ/Ohbwg42keJ1F6vqnglt6QEYERFXWRom4Kxk170TbqUSwXpjstZUlPl KOAiHbL2S3Q2A== Subject: Re: Apache log rotation To: =?UTF-8?Q?Morgan_Wesstr=c3=b6m?= Cc: questions@freebsd.org References: <334c1023-8283-2c41-f284-ccc44bae6d0a@pp.dyndns.biz> From: Robert Fitzpatrick Message-ID: Date: Mon, 17 Jul 2023 12:01:56 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.60 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 In-Reply-To: <334c1023-8283-2c41-f284-ccc44bae6d0a@pp.dyndns.biz> Content-Type: multipart/alternative; boundary="------------17F58F1EEA4F7BE8BAB7C956" Content-Language: en-US X-Virus-Scanned: WebTent Mailguard 1.0.4_3 X-Rspamd-Queue-Id: 4R4Rfd4jjvz42Rt X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16724, ipnet:208.38.128.0/18, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N This is a multi-part message in MIME format. --------------17F58F1EEA4F7BE8BAB7C956 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit > Morgan Wesström > Monday, July 17, 2023 8:19 AM > > > I don't have an answer for your specific problem but just wanted to > suggest an alternative solution. Have you looked at sysutils/cronolog? > Instead of relying on logrotate and restarting the apache process you > simply pipe the logs to cronolog which splits them according to a > pattern you define. Apache will run uninterrupted and logrotate won't > be used at all. > > Snippets from my own conf files that splits the logfiles per > year-month (note the pipe sign): > > ErrorLog "|/usr/local/sbin/cronolog > /var/log/apache24/httpd-error.%Y%m.default.log" > CustomLog "|/usr/local/sbin/cronolog > /var/log/apache24/httpd-access.%Y%m.default.log" combinedio Thanks, could be very helpful. --------------17F58F1EEA4F7BE8BAB7C956 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Monday, July 17, 2023 8:19 AM


I don't have an answer for your specific problem but just wanted to suggest an alternative solution. Have you looked at sysutils/cronolog? Instead of relying on logrotate and restarting the apache process you simply pipe the logs to cronolog which splits them according to a pattern you define. Apache will run uninterrupted and logrotate won't be used at all.

Snippets from my own conf files that splits the logfiles per year-month (note the pipe sign):

ErrorLog "|/usr/local/sbin/cronolog /var/log/apache24/httpd-error.%Y%m.default.log"
CustomLog "|/usr/local/sbin/cronolog /var/log/apache24/httpd-access.%Y%m.default.log" combinedio
Thanks, could be very helpful. --------------17F58F1EEA4F7BE8BAB7C956--