Hi,

I hope this helps. 

As other have said, there has been a move to let systemctl manage log files, 
and we now access the logs via journalctl.

That said, I did find this command returned some info:

# grep "postfix\|open" /var/log/syslog
Nov 29 02:20:35 mail postfix/postfix-script[1522]: starting the Postfix mail 
system
Nov 29 02:20:35 mail postfix/master[1524]: daemon started -- version 3.5.25, 
configuration /etc/postfix

But to manage postfix, I have been using these commands:

# journalctl -u postfix

or

# journalctl -u postfix@-.service

or if I have also implemented DKIM and DMARC, then

# journalctl -u postfix@-.service -u opendkim -u opendmarc

If in a terminal I want to monitor in real time I use the -f option:

# journalctl -f -u postfix@-.service -u opendkim -u opendmarc

I have seen the use of -t which allows the specification of multiple 
identifiers. 
journalctl -t postfix

journalctl -t postfix -t postfix/anvil -t postfix/bounce -t postfix/cleanup -t 
postfix_container -t postfix/error -t postfix/local -t postfix/master -t 
postfix/pickup -t postfix/postalias -t postfix/postfix-script -t 
postfix/proxymap -t postfix/qmgr -t postfix/scache -t postfix/sendmail -t 
postfix/smtp -t postfix/smtpd -t postfix/tlsmgr -t postfix/trivial-rewrite


https://man7.org/linux/man-pages/man1/journalctl.1.html

To show all fields emitted by a unit and about the unit, option
       -u/--unit= should be used.

       -t, --identifier=SYSLOG_IDENTIFIER
           Show messages for the specified syslog identifier
           SYSLOG_IDENTIFIER.

           This parameter can be specified multiple times.

Today I discovered this useful line ( read up on the options from "man 
journalctl" :

 journalctl --no-pager --quiet --identifier='postfix/smtp' --since='2022-10-30 
00:00:00' --until='2024-12-06 23:59:59' --output='short'
 journalctl --no-pager --quiet --identifier='postfix/smtp' --since='2022-10-30 
00:00:00' --until='2024-12-06 23:59:59' --output='short'

PAGER CONTROL OPTIONS         top

       The following options control page support:

       --no-pager
           Do not pipe output into a pager.

       -q, --quiet
           Suppresses all informational messages (i.e. "-- Journal
           begins at ...", "-- Reboot --"), any warning messages
           regarding inaccessible system journals when run as a normal
           user.

       -t, --identifier=SYSLOG_IDENTIFIER
           Show messages for the specified syslog identifier
           SYSLOG_IDENTIFIER.

FILTERING OPTIONS         top
The following options control how to filter journal records: -S, --since=, -U, 
--until= Start showing entries on or newer than the specified date, or on or 
older than the specified date, respectively.

       -o, --output=
           Controls the formatting of the journal entries that are
           shown. Takes one of the following options:

           short
               is the default and generates an output that is mostly
               identical to the formatting of classic syslog files,
               showing one line per journal entry.

               Added in version 206.

           short-full
               is very similar, but shows timestamps in the format the
               --since= and --until= options accept. Unlike the
               timestamp information shown in short output mode this
               mode includes weekday, year and timezone information in
               the output, and is locale-independent.

               Added in version 232.

George.

On Friday, 29-11-2024 at 11:07 Bitfox wrote:
> My OS is debian 12 without GUI.
> 
> After I installed postifx by apt, I can't find the path to mail.log.
> 
> the log file in /var/log doesn't exist.
> 
> do you know where is my mail.log now?
> 
> Thanks.
> 
> 

Reply via email to