esm.sh icon indicating copy to clipboard operation
esm.sh copied to clipboard

Log to stdio?

Open mattmueller-stripe opened this issue 3 months ago • 2 comments

Hi there! We're trying to self-host https://esm.sh and having the option to log to stdout/stderr would be very helpful in debugging issues. Would it be possible to configure the logger?

Maybe something like:

LOG_PATH=/esm/log
LOG_PATH=stderr

Thanks!

mattmueller-stripe avatar Oct 13 '25 20:10 mattmueller-stripe

you can configure the log in the config.json:

{
  // The log directory, default is "~/.esmd/log".
  "logDir": "~/.esmd/log",

  // The log level, available values are ["debug", "info", "warn", "error"], default is "info".
  "logLevel": "info",
}

to uses stderr to log errors, start the server via go run -tags debug server/esmd/main.go --config=config.json

ije avatar Oct 14 '25 00:10 ije

Ah okay, we're starting it via the Docker container, so I don't think there's an easy way to customize the build tags

mattmueller-stripe avatar Oct 14 '25 02:10 mattmueller-stripe