[logback-user] Include multiple files

Jędrzej Dudkiewicz jedrzej.dudkiewicz at gmail.com
Wed Oct 27 19:01:26 CEST 2021


Hi,
I wrote a question some time ago on stack overflow regarding
functionality that I'm looking for:

https://stackoverflow.com/questions/64215749/logback-is-there-a-way-to-include-all-config-files-from-directory

Unfortunately I only got one comment and it seems that functionality
is not there. Is there any way to achieve what I want to do? I hasten
to add that our application is a spring-boot based application (based
on Tomcat) and we really don't know anything about modules that people
write for it - but we know that some people do.

I'm pasting my question from SO below:

Is there a way to do something along the lines:

<configuration>
  <include file="src/main/java/chapters/configuration/*.xml" />
<!-- some common stuff -->
</configuration>

Note *.xml in <include> tag. I have an application consisting of 9
modules, but not all of them are always present. In addition there are
external modules that can be installed optionally and I don't know
their names in advance (by names I mean class names or config names)
or how they should be configured. If there was a way to include files
using wildcard I could simply notify developers that they should place
their config files in some directory (e.g. config/logging/) and I'd be
set for life. Currently files must be included by hand. Of course I
could write some code that monitors given file for new configurations
and include them programmatically in main configuration file (or
proper <include> tags), but maybe there is already a way to do it.

-- 
Jędrzej Dudkiewicz

I really hate this damn machine, I wish that they would sell it.
It never does just what I want, but only what I tell it.


More information about the logback-user mailing list