Re: [Toaster] [PATCH] Toaster: Write logs to BUILDDIR/toaster_logs

Richard Purdie <[email protected]> Fri, 27 Oct 2023 08:33:32 +0100
Newsgroups org.yoctoproject.lists.toaster
Message-ID <50680e489fa2a853b6c11cbbd66c073ca7b187f0.camel@linuxfoundation.org>
On Thu, 2023-10-26 at 19:28 -0700, Tim Orling wrote:
> Tested in both local and container environments.
> 
> On Thu, Oct 26, 2023 at 5:36 PM Alassane Yattara
> <[email protected]> wrote:
> > Fixes "2efb14648 toaster: Monitoring - implement Django logging
> > system" when
> > running in a container.
> > 
> > When running in a container, the previous approach of using
> > BASE_DIR
> > is not a writable path. Also, we really do not want to be writing
> > logs into
> > the source tree, as the BASE_DIR was resolving to
> > bitbake/lib/toaster/logs
> > 
> > Since Toaster is only ever running in an environment where oe-init-
> > buildenv
> > or similar has been sourced, we should instead write the logs to
> > BUILDDIR.
> > 
> > Using BUILDDIR to logs make path writable but django-log-viewer
> > does'nt manage
> > to write logs using an absolute path as BUILDDIR, where the
> > existing toaster_ui.log
> > was already being written.
> > 
> > Also drop the /logs/ directory, as it has not been created which
> > also breaks
> > in a container environment
> > 
> > To handle the constraints linked to django-log-viewer and /logs/,
> > we've updated
> > bitbake/bin/toaster to create a toaster_logs/ directory in BUILDDIR
> > if it doesn't exist,
> > when toaster starts up.
> > 
> > Also manage to set BUILDDIR/toaster_logs/ as default location for
> > toaster logs.
> > 
> > Signed-off-by: Alassane Yattara
> > <[email protected]>
> > Signed-off-by: Tim Orling <[email protected]>
> > 
> 
> Tested-by: Tim Orling <[email protected]> 
> 

Thanks Tim and Alassane, I know that one was a pain to get to the
bottom of! I've merged it.

Cheers,

Richard