Re: Apache logs and systemd

2023-06-16 Thread Andy Smith
Hello,

On Fri, Jun 16, 2023 at 12:38:40PM -0500, Tom Browder wrote:
> I should have mentioned in OP the logs are in a dir under my own apache
> installation dir, and they are text files. I’ll try to get “logrotate” to
> take them over.

It should happen by default.

Normally logrotate is called by a systemd timer:

$ systemctl status logrotate.timer

(on a sysvinit system this will be by an init script instead, but
again, I'm assuming you haven't gone too far out of your way to be
non-default)

The apache2 package ships the logrotate config snippet at
/etc/logrotate.d/apache2. That file should show the paths to your
apache2 log files.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: Apache logs and systemd

2023-06-16 Thread Tom Browder
On Thu, Jun 15, 2023 at 16:57 Andy Smith  wrote:

> Hi Tom,
>
> On Thu, Jun 15, 2023 at 01:52:10PM -0500, Tom Browder wrote:
> > Maybe it's related to the rsyslog changes ?
>
> apache by default does not use a syslog for logging though, it

…

Thanks, Andy.

I should have mentioned in OP the logs are in a dir under my own apache
installation dir, and they are text files. I’ll try to get “logrotate” to
take them over.

Best regards,

-Tom


Re: Apache logs and systemd

2023-06-15 Thread Andy Smith
Hi Tom,

On Thu, Jun 15, 2023 at 01:52:10PM -0500, Tom Browder wrote:
> Maybe it's related to the rsyslog changes ?

apache by default does not use a syslog for logging though, it
writes logfiles itself directly. On a normal Debian distribution
these are rotated by the logrotate package.

So any amount of messing about with rsyslog or systemd is not going
to help, unless you went out of your way to make apache log to
syslog and/or journald to begin with.

If your log files are in /var/log/apache2 that is a good sign that
they are being logged by the apache2 process itself, as per usual.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: Apache logs and systemd

2023-06-15 Thread Tom Browder
On Wed, Jun 14, 2023 at 13:18 zithro  wrote:

> On 14 Jun 2023 19:30, Tom Browder wrote:

...

> I’ve been running httpd for many years, long before systemd came along.
> > Somewhere in the various upgrades over the years I lost the old rotating
> > logs.
> > Now I would like to initiate the rotating logs again. Can I do that with
> > systemd somehow?

...

Maybe it's related to the rsyslog changes ?
>
 From bullseye on, the package "rsyslog" is not mandatory anymore, and
> from bookworm, it's not even installed by default, but not disabled.
>
> You don't tell which Debian version you're using rn, but if bookworm,
> there is some info in bookworm release notes about rsyslog :

...

Thanks for the links. I'm running 10.3 on one server and 11 on the other
(can't remenber the names anymore since they all start with "b" it seems).
 :-)

-Tom


Re: Apache logs and systemd

2023-06-15 Thread Tom Browder
On Wed, Jun 14, 2023 at 13:15 Greg Wooledge  wrote:

> On Wed, Jun 14, 2023 at 12:30:37PM -0500, Tom Browder wrote:

..,

> If you want text log FILES (e.g. /var/log/whatever), install the rsyslog
> package.  For rotation, install logrotate.


Thank you.

...

> Systemd by itself only creates binary journals, which have to be read
> with journalctl.  There is absolutely no option to write text log files
> with systemd alone.


I was not aware of that, thanks.

-Tom


Re: Apache logs and systemd

2023-06-14 Thread zithro

On 14 Jun 2023 19:30, Tom Browder wrote:

I’ve been running httpd for many years, long before systemd came along.
Somewhere in the various upgrades over the years I lost the old rotating
logs.

Now I would like to initiate the rotating logs again. Can I do that with
systemd somehow?


Isn't that the job of "logrotate" ?

Maybe it's related to the rsyslog changes ?
From bullseye on, the package "rsyslog" is not mandatory anymore, and 
from bookworm, it's not even installed by default, but not disabled.


You don't tell which Debian version you're using rn, but if bookworm, 
there is some info in bookworm release notes about rsyslog :

5.1.7
https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#changes-to-system-logging
5.1.9
https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#rsyslog-creates-fewer-logfiles
And maybe 5.1.8 :
https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#rsyslog-timestamp-change-affects-logcheck



Re: Apache logs and systemd

2023-06-14 Thread Greg Wooledge
On Wed, Jun 14, 2023 at 12:30:37PM -0500, Tom Browder wrote:
> I’ve been running httpd for many years, long before systemd came along.
> Somewhere in the various upgrades over the years I lost the old rotating
> logs.
> 
> Now I would like to initiate the rotating logs again. Can I do that with
> systemd somehow?

If you want text log FILES (e.g. /var/log/whatever), install the rsyslog
package.  For rotation, install logrotate.

Systemd by itself only creates binary journals, which have to be read
with journalctl.  There is absolutely no option to write text log files
with systemd alone.