omar-polo / gmid

a Gemini server
https://gmid.omarpolo.com
ISC License
103 stars 6 forks source link

Log location. #34

Open LucasMW opened 4 months ago

LucasMW commented 4 months ago

Might be a dumb question, but I cannot find anywhere else.

Does gmid keeps a log of what happens and the requests it serves? Like what gemexp outputs to stdout Where is the default location for that? I can't find it.

Thanks in advance.

omar-polo commented 4 months ago

It's not a dumb question. While it's documented, it's done a bit sparingly:

The log documentation is here: https://gmid.omarpolo.com/gmid.conf.5.html#log

LucasMW commented 4 months ago

Thanks, I will give it a look. It's the first time I read about syslog, but now I have a keyword to search. The log option in conf might solve my problem as well. Thanks!

omar-polo commented 4 months ago

Let me clarify one point:

gmid by defaults logs to syslog, and where that actually ends up to depends on your configuration

with "your configuration" I really meant your syslog implementation and how it's configured. If you're using a systemd-based distribution, I believe it will end up in the journal. On OpenBSD, with the default configuration, the logs will end up in /var/log/messages and /var/log/daemon, but by changing /etc/syslog.conf you can tell syslog to log gmid to some other file.

agrajag9 commented 3 months ago

An example in the docs would be nice. It took me some trial and error to figure out, but:

user "_gmid"
chroot "/var/gemini"
dir = "/var/gemini"
certdir = "/usr/local/etc/letsencrypt/live"
log access "gmid.log"

server "example.com" {
...

This will log to /var/gemini/gmid.log

omar-polo commented 3 months ago

@agrajag9 yeah, an example would be nice. I added something in the "EXAMPLES" section of the manpage, could that have worked for you?

agrajag9 commented 3 months ago

Yes, that's perfect! Thank you very much