Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log location. #34

Open
LucasMW opened this issue Jul 8, 2024 · 6 comments
Open

Log location. #34

LucasMW opened this issue Jul 8, 2024 · 6 comments

Comments

@LucasMW
Copy link

LucasMW commented Jul 8, 2024

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
Copy link
Owner

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

  • gmid by defaults logs to syslog, and where that actually ends up to depends on your configuration
  • if you run gmid with the -f (foreground) option, it will also print to logs to standard error (and won't put itself in the background)
  • log access "/path/to/file" can be used to log to a file (in addition to syslog and/or stderr)

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

@LucasMW
Copy link
Author

LucasMW commented Jul 8, 2024

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
Copy link
Owner

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
Copy link

agrajag9 commented Aug 2, 2024

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 added a commit that referenced this issue Aug 3, 2024
Few grammar and style fixes, plus add an example about logging on
a file.

Prodded by #34
@omar-polo
Copy link
Owner

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

@agrajag9
Copy link

agrajag9 commented Aug 5, 2024

Yes, that's perfect! Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants