# Tip: Log console messages



## mix_room (Jan 7, 2010)

Several times I have been really annoyed when there are messages printed to console which pass by too fast for me to be able to read, or are too long to copy down. But yesterday I found a solution:

in /etc/syslog.conf


```
# uncomment this to log all writes to /dev/console to /var/log/console.log
console.info                        /var/log/console.log
```

Then create the corresponding log file, or syslogd will fail to start. 

```
# touch /var/log/console.log
```

[cmd=""]/etc/rc.d/syslogd restart[/cmd]

And now your console messages will be logged to console.log for you to read when you have plenty of time, a nice editor or what ever else was the problem before.


----------



## Alt (Jan 7, 2010)

Just push ScrollLock and use PageUp/Dn =)


----------



## mix_room (Jan 7, 2010)

Alt said:
			
		

> Just push ScrollLock and use PageUp/Dn =)



Still doesn't store it for future use. Or let you automagically send it to somewhere else.


----------



## rbelk (Jan 7, 2010)

I have used this tip for a long time, it is great If you don't have access to the physical console.


----------



## viento (Jan 15, 2010)

That's very helpful.  Now, how can I prevent all of those messages from being shown in the console?  I'd like to hide certain info from being shown on the terminal, like the IP address from DHCP, which services load, etc.

I commented out the following line in /etc/syslog.conf, but the messages still appear:
	
	



```
#*.err;kern.*;auth.notice;authpriv,remoteauth,install.none;mail.crit             /dev/console
```


----------



## rbelk (Jan 15, 2010)

Viento, did you restart syslog with /etc/rc.d/syslogd restart?


----------



## viento (Jan 15, 2010)

rbelk said:
			
		

> Viento, did you restart syslog with /etc/rc.d/syslogd restart?



No, I was restarting the system to test the output on the console, so that probably had the same effect.

Also, I created a new thread to specifically address this and make it easily indexed by search engines:

http://forums.freebsd.org/showthread.php?t=10341


----------



## graudeejs (Jan 15, 2010)

isn't content the same as /var/log/messages?


----------

