diff --git a/server/main.c b/server/main.c index 556609c..90c6c62 100644 --- a/server/main.c +++ b/server/main.c @@ -27,8 +27,9 @@ int main(int argc, char **argv) { - struct render_context_args ctx_args; + render_log_init(); + struct render_context_args ctx_args; bool ok = render_server_main(argc, argv, &ctx_args); /* this is a subprocess */ diff --git a/server/render_common.c b/server/render_common.c index 3498dff..e51bb88 100644 --- a/server/render_common.c +++ b/server/render_common.c @@ -7,6 +7,13 @@ #include #include +#include + +void +render_log_init(void) +{ + openlog(NULL, LOG_NDELAY | LOG_PERROR | LOG_PID, LOG_USER); +} void render_log(const char *fmt, ...) @@ -14,10 +21,6 @@ render_log(const char *fmt, ...) va_list va; va_start(va, fmt); - - fprintf(stderr, "render: "); - vfprintf(stderr, fmt, va); - fprintf(stderr, "\n"); - + vsyslog(LOG_DEBUG, fmt, va); va_end(va); } diff --git a/server/render_common.h b/server/render_common.h index 3510fa1..33707ec 100644 --- a/server/render_common.h +++ b/server/render_common.h @@ -29,6 +29,9 @@ struct render_virgl; struct render_worker; struct render_worker_jail; +void +render_log_init(void); + void render_log(const char *fmt, ...);