Re: [PATCH] hv/hv_kvp_daemon: Enable debug logs for hv_kvp_daemon

From: Shradha Gupta
Date: Thu Mar 27 2025 - 01:05:44 EST


On Tue, Mar 25, 2025 at 03:14:56PM +0000, Wei Liu wrote:
> On Mon, Mar 24, 2025 at 11:24:08PM -0700, Shradha Gupta wrote:
> [...]
> > > > @@ -1662,6 +1755,7 @@ void print_usage(char *argv[])
> > > > fprintf(stderr, "Usage: %s [options]\n"
> > > > "Options are:\n"
> > > > " -n, --no-daemon stay in foreground, don't daemonize\n"
> > > > + " -d, --debug-enabled Enable debug logs\n"
> > >
> > > You should specify where the log is written to. The only place that
> > > tells where it is written to is in syslog.
> > >
> > I can add the log location here as well, thanks.
> >
> > > Does systemd has a way to collect logs from a specific daemon? If so,
> > > we can consider using that facility
> >
> > yeah, using services that can be done. For hv_kvp_daemon, the services
> > are defined and configured by distro vendors(ex:
> > rhel:-hypervkvpd.service, ubuntu:-hv-kvp-daemon.service). Using
> > StandardOutput, StandardError directives(for these services), these logs
> > can be configured to be visible in journalctl logs as well.
>
> Yes, I would rather use systemd's logging facility. That simplifies this
> patch. You won't need to handle a log file yourself.
>
> Thanks,
> Wei.
Thanks Wei. Summarizing the changes in next version, I will skip the log
file and add debug log in syslog as LOG_DEBUG. This would be enabled
with -d(debug-enabled) flag in the the daemon. The Distro vendors can
modify their service file configuration to redirect/view these logs
accordingly.