Skip to contentSkip to conversation

Log output going to screen

DISCUSSION George Agnelli 3 participants 4 messages Oct 16, 2002

lore
Share & tools
lore
#0 lore raw

Does anyone know why my logs are occasionally being dumped to screen as well as to the messages file? How can I stop this happening?

This is what I am currently logging:

iptables -A INPUT -i eth1 -j LOG
iptables -A OUTPUT -o eth1 -j LOG
iptables -A FORWARD -i eth1 -o eth0 -j LOG
iptables -A FORWARD -i eth0 -o eth1 -j LOG

George

#1 lore raw

check your /etc/syslog.conf to make sure it doesn't contain a line like 'kern.* /dev/console'. If that doesn't work, try starting your klogd with the switch '-c 3'

redhat /etc/init.d/syslog, start function

start() {
echo -n $"Starting system logger: " daemon syslogd $SYSLOGD_OPTIONS
RETVAL=$?
echo
echo -n $"Starting kernel logger: " daemon klogd $KLOGD_OPTIONS -c 3
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/syslog return $RETVAL
}

----- Original Message -----
From: "George Agnelli" <[email protected]>
To: <[email protected]>
Sent: Wednesday, October 16, 2002 4:41 PM
Subject: Log output going to screen

Quoted 1 line

Does anyone know why my logs are occasionally being dumped to screen as

well

Quoted 12 lines

as to the messages file? How can I stop this happening?

This is what I am currently logging:

iptables -A INPUT -i eth1 -j LOG iptables -A OUTPUT -o eth1 -j LOG iptables -A FORWARD -i eth1 -o eth0 -j LOG iptables -A FORWARD -i eth0 -o eth1 -j LOG

George

#2 lore raw

Log rules

In reply to George Agnelli

Hi,

I have following rules in my firewall script. It's dumping lot of error message. I want to capture all incoming outgoing packet on the external interface. How will I change this rules.

# Log the packet
for chain in INPUT OUTPUT FORWARD PREROUTING POSTROUTING do
for table in filter mangle nat
do

    $IPT -I $chain -t $table -j LOG --log-prefix="$chain $table "

done
done

Is there any log analyzing tools for iptables log. Thanks
SR

#3 lore raw
In reply to George Agnelli
Quoted 2 lines · George Agnelli

Does anyone know why my logs are occasionally being dumped to screen as well as to the messages file? How can I stop this happening?

What do you mean by "occasionally" ?

Your system should at least be consistent about where it sends its log entries.

Quoted 1 line

iptables -A INPUT -i eth1 -j LOG

Try adding a "--log-level=info" (or replace info with 3 if you have a version of iptables which doesn't like the log names) and make sure you have a suitable entry in your /etc/syslog.conf to send 'info' level messages to the desired destination, eg:

*.=info /var/log/messages

Antony

Signature · 2 lines
The difference between theory and practice is that
in theory there is no difference, whereas in practice there is.