[wildfly-dev] Embedded servers, modules and logging

Brian Stansberry brian.stansberry at redhat.com
Fri Dec 4 10:58:35 EST 2015


On 12/3/15 6:27 PM, Ken Wills wrote:
> [resending as the last one got held for moderation for some reason].
>
> Hi All,
>
> I've been working on a fix for
> https://issues.jboss.org/browse/WFCORE-950, and while I think I have the
> problem mitigated, a couple of issues have turned up regarding starting
> & stopping an embedded instance (either standalone or host-controller)
> and resetting / reloading modules. I'm not sure if these are realistic
> goals for this, so I'm asking here :)
>
> 1) Modules: during embedded start a module loader is obtained via
> Module.getBootModuleLoader(). This in turn initializes a static var to
> return it's BOOT_MODULE_LOADER. In the case of stopping an embedded
> server and restarting with a new --jboss-home-dir, subsequent module use
> continues to return the original BOOT_MODULE_LOADER.  I expect this
> isn't a normal use case of modules, so I'm looking for some suggestions
> regarding perhaps the addition of a reset() method to Module or
> something similar to allow this behavior. Would this be a good idea?
> Other thoughts? (Note, I'll probably do this as a different change from
> #950.)
>

As modular apps become more common I can see why letting an embedding 
app wanting to embed different modular apps would become more common. 
But, just having a reset or something only allows embedding > 1 in 
series, not concurrently, so that limits the likely use cases.

OTOH perhaps the embedding app will become modular as well, which is a 
whole different problem.

I think a more general solution here will involve being able to set up 
independent modular classloading spaces not based on the boot module 
loader. We have a different but somewhat similar issue when the CLI 
process itself is modular -- the embedded server must load modules from 
the same module path as the CLI itself. That's another variant of the 
embedded app not having its only isolated classloading space.

> 2) Property org.jboss.boot.log.file: This gets set on the first embedded
> server start, and I can't find where the actual logger is referencing
> the logfile in order to reset it to the new jboss-home-dir. Anyone have
> a clue for me? :^) Subsequent embedded servers continue to log to the
> previous server.log, which I expect will confuse people somewhat.
>

James Perkins should know the answer to this one.

> Thanks!
>
> Ken
>
>
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>


-- 
Brian Stansberry
Senior Principal Software Engineer
JBoss by Red Hat


More information about the wildfly-dev mailing list