-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
enhancementAdditions or updates to featuresAdditions or updates to features
Description
Many Log4j components use URI-sh configuration attributes:
- configuration factories allow a
ConfigurationSourceto be specified as URI, URL or file name, - the
MutableThreadContextMapFilteraccepts an URI or file name to retrieve its configuration, - JSON Template Layout accepts an URI to retrieve its configuration.
Each of these configuration attributes is handled in a different way. For example:
- JTL only handles
file:andclasspath:URIs, - the way URIs without a schema are interpreted differs.
We should introduce an abstraction similar to ResourceLoader that:
- supports at least the
classpath,file,httpandhttpsprotocols, - is extensible to new protocol handlers,
- specifies how a relative URI without a protocol needs to be interpreted. This mechanism should be extensible: e.g. a standard implementation could interpret it as
classpathorfileresources. Alog4j-webspecific implementation could interpret it aswar,classpathorfileresource, - has a coherent way to handle errors: file names and Java URLs don't always follow the URI syntax.
Remark: other Log4j components might also profit from this abstraction. For example the File appender could be easily adapted to use network filesystem URIs or at least it should be able to use NIO file systems.
paulmarcelinbejan
Metadata
Metadata
Assignees
Labels
enhancementAdditions or updates to featuresAdditions or updates to features
Type
Projects
Status
To triage