You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was struggling with the task of adding timestamps for build logs, because applied changes for log4j logger didn’t applied on a build process. In other words, if you use eoc with the new version of eo-maven-plugin (where we already added timestamps for log4j logs), you still will see the next output:
[INFO] There are 33 EO sources registered already
[INFO] Registered 1 EO sources from ./Users/lombrozo/Workspace/EOlang/Projects/learning to ./Users/lombrozo/Workspace/EOlang/Projects/learning/.eoc/eo-foreign.json, included [**.eo], excluded [.eoc/**]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.536 s
[INFO] Finished at: 2022-11-10T21:46:32+03:00
[INFO] ------------------------------------------------------------------------
Why? Because we use logs frameworks like this (I can be wrong in details):

As you can see, we expect to use log4j implementation for slf4j, but here is a trick: Since 3.1.x version of maven, the default maven distributive uses its own slf4j implementation - slf4j-simple, in other words, our picture changes to the next:

You can check maven that installed on your laptop and in the maven lib directory you probably will find the next jars:
2022-10-11 21:49:00 [INFO] Assemble cycle #1 (eo:33/xmir:33/xmir2:33/discovered:33 -> eo:33/xmir:33/xmir2:33/discovered:33), took 3s
2022-10-11 21:49:00 [INFO] 1 assemble cycle(s) produced some new object(s): eo:33/xmir:33/xmir2:33/discovered:33
2022-10-11 21:49:00 [INFO] ------------------------------------------------------------------------
2022-10-11 21:49:00 [INFO] BUILD SUCCESS
2022-10-11 21:49:00 [INFO] ------------------------------------------------------------------------
2022-10-11 21:49:00 [INFO] Total time: 3.203 s
2022-10-11 21:49:00 [INFO] Finished at: 2022-11-10T21:49:00+03:00
2022-10-11 21:49:00 [INFO] ------------------------------------------------------------------------
Remove slf3j-simple from mvnw distributive (I don’t know if it’s even possible). But at least, you can try to remove slf4j-simple from your maven/lib folder and log4j will work fine.
Useful links:
More detailed about maven logging you can read here.
I was struggling with the task of adding timestamps for build logs, because applied changes for
log4j
logger didn’t applied on a build process. In other words, if you useeoc
with the new version ofeo-maven-plugin
(where we already added timestamps forlog4j
logs), you still will see the next output:Why? Because we use logs frameworks like this (I can be wrong in details):

As you can see, we expect to use
log4j
implementation forslf4j
, but here is a trick: Since 3.1.x version of maven, the default maven distributive uses its ownslf4j
implementation -slf4j-simple
, in other words, our picture changes to the next:
You can check maven that installed on your laptop and in the maven
lib
directory you probably will find the next jars:Since
slf4j
chooses only one logging implementation, we have only 2 options here to add timestamps for build logs:slf4j-simple
logger directly. To do so we can just add the next arguments for all maven commandsThen all maven build logs will look like:
slf3j-simple
frommvnw
distributive (I don’t know if it’s even possible). But at least, you can try to removeslf4j-simple
from yourmaven/lib
folder andlog4j
will work fine.Useful links:
slf4j-simple
logger.The text was updated successfully, but these errors were encountered: