[Log4j] In 2.x, drop log4j-mongodb3 and add log4j-mongodb5
Hello All, In In 2.x, I would like to: - drop log4j-mongodb3 and - add log4j-mongodb5 - then do the same in 3.x Any objections? Gary
Re: [Log4j] In 2.x, drop log4j-mongodb3 and add log4j-mongodb5
Hi Gary, On Wed, 17 Apr 2024 at 16:36, Gary D. Gregory wrote: > > Hello All, > > In In 2.x, I would like to: > > - drop log4j-mongodb3 and > - add log4j-mongodb5 > - then do the same in 3.x > > Any objections? It is fine with me. Regarding log4j-mongodb5: MongoDB driver has already been upgraded to version 5.0.0 in `main` by Dependabot and the unit tests passed. Do we need another artifact or we just need to test it against version 4.11 and 5.0 of the driver? Piotr
Re: [Log4j] In 2.x, drop log4j-mongodb3 and add log4j-mongodb5
Hi Piotr, Having mongodb4 module depend on the mongodb 5 driver sure is confusing though. What I don't know and don't want to deal with is "I updated to the latest log4j-mongdb5 version and my app no longer works" because it might turn out that the newer 5.x driver drops support for older Mongo versions. Since we established support for major versions of the driver for 3 and 4, I thought it conceptually simpler to do the same for 5. WDYT? Gary On Wed, Apr 17, 2024, 11:24 AM Piotr P. Karwasz wrote: > Hi Gary, > > On Wed, 17 Apr 2024 at 16:36, Gary D. Gregory wrote: > > > > Hello All, > > > > In In 2.x, I would like to: > > > > - drop log4j-mongodb3 and > > - add log4j-mongodb5 > > - then do the same in 3.x > > > > Any objections? > > It is fine with me. > > Regarding log4j-mongodb5: MongoDB driver has already been upgraded to > version 5.0.0 in `main` by Dependabot and the unit tests passed. Do we > need another artifact or we just need to test it against version 4.11 > and 5.0 of the driver? > > Piotr >
Re: [Log4j] In 2.x, drop log4j-mongodb3 and add log4j-mongodb5
Maybe if want to only use the latest driver for main, we should rename the module and classes and drop the "4". That or go with what I initially suggested. Gary On Wed, Apr 17, 2024, 12:18 PM Gary Gregory wrote: > Hi Piotr, > > Having mongodb4 module depend on the mongodb 5 driver sure is confusing > though. What I don't know and don't want to deal with is "I updated to the > latest log4j-mongdb5 version and my app no longer works" because it might > turn out that the newer 5.x driver drops support for older Mongo versions. > Since we established support for major versions of the driver for 3 and 4, > I thought it conceptually simpler to do the same for 5. > > WDYT? > > Gary > > On Wed, Apr 17, 2024, 11:24 AM Piotr P. Karwasz > wrote: > >> Hi Gary, >> >> On Wed, 17 Apr 2024 at 16:36, Gary D. Gregory >> wrote: >> > >> > Hello All, >> > >> > In In 2.x, I would like to: >> > >> > - drop log4j-mongodb3 and >> > - add log4j-mongodb5 >> > - then do the same in 3.x >> > >> > Any objections? >> >> It is fine with me. >> >> Regarding log4j-mongodb5: MongoDB driver has already been upgraded to >> version 5.0.0 in `main` by Dependabot and the unit tests passed. Do we >> need another artifact or we just need to test it against version 4.11 >> and 5.0 of the driver? >> >> Piotr >> >
Re: [Log4j] In 2.x, drop log4j-mongodb3 and add log4j-mongodb5
Hi Gary, On Wed, 17 Apr 2024 at 18:45, Gary Gregory wrote: > Maybe if want to only use the latest driver for main, we should rename the > module and classes and drop the "4". That or go with what I initially > suggested. Your initial proposal of having a separate `log4j-mongodb4` and `log4j-mongodb5` modules might actually be easier to understand for users. We can however reduce maintenance work by setting `log4j-mongodb4` as dependency for `log4j-mongodb5`, bumping the dependency on MongoDB Java Driver in that artifact only and have a single class that reuses the `log4j-mongodb4` artifact. @Plugin("MongoDb5") public final class MongoDb5Provider { private MongoDb5Provider() {} @PluginFactory public static MongoDb4Provider.Builder newBuilder() { return new MongoDb4Provider.Builder<>(); } } WDYT? Piotr
Re: [Log4j] In 2.x, drop log4j-mongodb3 and add log4j-mongodb5
But then your config has to say AND depend on the mongodb5 module! Still confusing 😕 On Wed, Apr 17, 2024, 2:29 PM Piotr P. Karwasz wrote: > Hi Gary, > > On Wed, 17 Apr 2024 at 18:45, Gary Gregory wrote: > > Maybe if want to only use the latest driver for main, we should rename > the > > module and classes and drop the "4". That or go with what I initially > > suggested. > > Your initial proposal of having a separate `log4j-mongodb4` and > `log4j-mongodb5` modules might actually be easier to understand for > users. > > We can however reduce maintenance work by setting `log4j-mongodb4` as > dependency for `log4j-mongodb5`, bumping the dependency on MongoDB > Java Driver in that artifact only and have a single class that reuses > the `log4j-mongodb4` artifact. > > @Plugin("MongoDb5") > public final class MongoDb5Provider { > > private MongoDb5Provider() {} > > @PluginFactory > public static MongoDb4Provider.Builder newBuilder() { > return new MongoDb4Provider.Builder<>(); > } > } > > WDYT? > > Piotr >
Re: [Log4j] In 2.x, drop log4j-mongodb3 and add log4j-mongodb5
Hi Gary, On Wed, 17 Apr 2024 at 21:23, Gary Gregory wrote: > But then your config has to say AND depend on the mongodb5 > module! Still confusing 😕 There is actually a rarely used feature of our plugin system, where a plugin named `Foo` can actually create an object of type `Bar`. See for example the `LoggerConfig.Root` plugin that actually creates an object of type `LoggerConfig`. In your config you will use `MongoDb5`, but the provider will be of type MongoDb4Provider. Piotr
Re: [Log4j] In 2.x, drop log4j-mongodb3 and add log4j-mongodb5
This is the plan that Piotr and I came up with one addition (1c): 1. Branch 2.x 1.a. Drop module log4j-mongodb3 1.b. Add module log4j-mongodb (no number) that contains one class that instantiates the log4j-mongodb4 provider. XML element is MongoDb. 1.c. Deprecate module log4j-mongodb4 in favor of log4j-mongodb 2. Branch main 2.a. Rename module log4j-mongodb4 to module log4j-mongodb 2.b. Rename XML element MongoDb4 to MongoDb Gary On 2024/04/17 19:49:40 "Piotr P. Karwasz" wrote: > Hi Gary, > > On Wed, 17 Apr 2024 at 21:23, Gary Gregory wrote: > > But then your config has to say AND depend on the mongodb5 > > module! Still confusing 😕 > > There is actually a rarely used feature of our plugin system, where a > plugin named `Foo` can actually create an object of type `Bar`. See > for example the `LoggerConfig.Root` plugin that actually creates an > object of type `LoggerConfig`. > > In your config you will use `MongoDb5`, but the provider will be of > type MongoDb4Provider. > > Piotr >
Re: [Log4j] In 2.x, drop log4j-mongodb3 and add log4j-mongodb5
Hi Piotr, Please see the branch feature/2.x/mongodb-next and its failing tests. TY, Gary On 2024/04/17 21:59:45 "Gary D. Gregory" wrote: > This is the plan that Piotr and I came up with one addition (1c): > > 1. Branch 2.x > 1.a. Drop module log4j-mongodb3 > 1.b. Add module log4j-mongodb (no number) that contains one class that > instantiates the log4j-mongodb4 provider. XML element is MongoDb. > 1.c. Deprecate module log4j-mongodb4 in favor of log4j-mongodb > > 2. Branch main > 2.a. Rename module log4j-mongodb4 to module log4j-mongodb > 2.b. Rename XML element MongoDb4 to MongoDb > > Gary > > On 2024/04/17 19:49:40 "Piotr P. Karwasz" wrote: > > Hi Gary, > > > > On Wed, 17 Apr 2024 at 21:23, Gary Gregory wrote: > > > But then your config has to say AND depend on the mongodb5 > > > module! Still confusing 😕 > > > > There is actually a rarely used feature of our plugin system, where a > > plugin named `Foo` can actually create an object of type `Bar`. See > > for example the `LoggerConfig.Root` plugin that actually creates an > > object of type `LoggerConfig`. > > > > In your config you will use `MongoDb5`, but the provider will be of > > type MongoDb4Provider. > > > > Piotr > > >