empiricaly / empirica

Open source project to tackle the problem of long development cycles required to produce software to conduct multi-participant and real-time human experiments online.
https://empirica.ly/
Apache License 2.0
45 stars 8 forks source link

Make server logging comprehensive by including file logging #548

Open kaglowka opened 5 months ago

kaglowka commented 5 months ago

Is there an existing issue for this?

Is your feature request related to a problem?

I think it'd be a good direction if Empirica included a more comprehensive server logging solution by default such that more detailed information could be logged in a file independently from console output, e.g. by setting different log levels for console logging and file logging. I think it would be reasonable if detailed logging was encouraged as a tool to monitor correct behaviour of the participant tasks during experiments.

That may be a naive question, as I'm not very familiar with js logging solutions, I only know nice solutions using logging module in vanilla Python, which makes me wonder if more comprehensive logging could be easily added to Empirica.

Describe the solution you'd like

An example default setting:

import { info, setLogLevel } from "@empirica/core/console";

Describe alternatives you've considered

Of course it's possible to implement such logging individually (in this particular case I'd need to delve into js logging modules that I don't know myself), but I have an intuition that comprehensive logging would be a very desirable default given the scientific application of Empirica -- so by default we learn about all potential glitches that may have happened during experiments, including any tiny suspicious events within Empirica's inner workings themselves. "debug" and "warn" logging calls for these could be added gradually in the future.

Teachability, Documentation, Adoption, Migration Strategy

No response

Code of Conduct

npaton commented 5 months ago

That's a good idea. Often the preferred way to log in server environment is to stdout/stderr, and let the system decide what to do with the logs. But during development at least, it would be nice to have a more verbose log go to a file by default, and if you have a problem, we have more info to work with. 👍