# Why does "devd" service write so much in /var/log & how to prevent this



## Alain De Vos (Dec 26, 2022)

Why does "devd" service write so much in /var/log & how to prevent this


----------



## Phishfry (Dec 26, 2022)

/etc/syslogd.conf is the controller.


```
# Uncomment this if you wish to see messages produced by devd
# !devd
# *.>=notice                    /var/log/devd.log
!*
```


----------



## George (Dec 26, 2022)

devd may run logger(), depending on the contents of the devd.conf file.
In your case, probably a driver massively reports (or logs) stuff?

syslogd is for logging.








						Chapter 13. Configuration and Tuning
					

This chapter explains much of the FreeBSD configuration process, including some of the parameters which can be set to tune a FreeBSD system.




					docs.freebsd.org
				




Doesn't the line 14 in the default etc/syslog.conf

```
!-devd
```

mean that anything coming from the program devd won't be logged?


The possible warning levels are* emerg*, *alert*, *crit*, *err*, *warning*, *notice*, *info* and *debug*

```
# Uncomment this if you wish to see messages produced by devd
# !devd
# *.>=notice                    /var/log/devd.log
```


----------



## ralphbsz (Dec 27, 2022)

On my system (was last installed in ~2016, more on that below, and is at version 12.3), there are zero messages from devd in /var/log/messages. And the log file /var/log/devd.log was created when the install ran (in December 2016), and hasn't had any entries added to it since.


----------



## smithi (Dec 27, 2022)

Alain De Vos said:


> Why does "devd" service write so much in /var/log & how to prevent this



Can you show a few lines to illustrate what's logging there?

Result of `% grep -1 devd /etc/syslog.conf`?


----------



## mer (Dec 27, 2022)

Is there anything in /etc/syslog.d?  That looks like typical "application dependency configuration"


----------



## smithi (Dec 27, 2022)

George said:


> Doesn't the line 14 in the default etc/syslog.conf
> 
> ```
> !-devd
> ...



No, it means that the following block applies to every program except devd.  See syslog.conf(5).  I had to read it a few times ...



George said:


> ```
> # Uncomment this if you wish to see messages produced by devd
> # !devd
> # *.>=notice                    /var/log/devd.log
> ```



I did that just after installing 12.3 last April; only a page of entries so far, mostly dropping disconnected or unresponsive clients, but handy for reporting a couple of syntax errors I made while adding code to devd.conf.


----------



## Alain De Vos (Dec 27, 2022)

I use syslog-ng.
I fixed it by not logging debug unless at least log-level notice.

```
source src {
        system();
        udp(ip("127.0.0.1"));
        };
destination D_sql { .... }
# log level filters
filter f_notice { level(notice..emerg); };
# *.=debug                        /var/log/debug.log
log { source(src); filter(f_notice); destination(D_sql); };
```


----------

