Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to runner for enabling DEBUG Mode #536

Open
TobiasNx opened this issue Jun 18, 2024 · 7 comments
Open

Add option to runner for enabling DEBUG Mode #536

TobiasNx opened this issue Jun 18, 2024 · 7 comments

Comments

@TobiasNx
Copy link
Contributor

At the moment you only can set JAVA embedded MF Workflows to debug mode. But it would be great to enable the debug mode for the CLI Version too. Thinking about adding an option debug=trueor something like this.

@TobiasNx TobiasNx changed the title Add option to runner for enable DEBUG Mode Add option to runner for enabling DEBUG Mode Jun 18, 2024
@fsteeg
Copy link
Member

fsteeg commented Jun 18, 2024

You mean for logging?

@TobiasNx
Copy link
Contributor Author

You mean for logging?

Changing INFO to DEBUG, like you would do here:
https://gitlab.com/oersi/oersi-etl/-/blob/68a658e994bcc5d870d9420560fcb517b8cc13c8/src/main/resources/log4j.properties#L7-10

@fsteeg
Copy link
Member

fsteeg commented Jun 18, 2024

Right, that should basically work the same way for the runner, in that case in config/log4j.xml. Not sure if it works though, I thought we had an issue for that (here or in the metafacture-fix repo), but I didn't find it now.

@TobiasNx
Copy link
Contributor Author

TobiasNx commented Nov 7, 2024

Since I test a lot of things via the command line with the Metafix Runner, this option would still be great.

@TobiasNx
Copy link
Contributor Author

TobiasNx commented Nov 7, 2024

Could this help? https://medium.com/@kasunbg/change-log4j2-default-logging-level-to-info-b25db8723eb9

Something like: Adding: -Dorg.apache.logging.log4j.level=DEBUG

@TobiasNx
Copy link
Contributor Author

TobiasNx commented Nov 7, 2024

Also metafacture-runner/src/main/dist/config/java-options.conf exists. It seems that the core included runner can adjust this. BUT the metafix runner cannot do this.

@dr0i
Copy link
Member

dr0i commented Nov 7, 2024

Let's do separation of concern : Fix is Fix and Core is Core.

You can use the debug logging using the CLI as follows:

#change the log level from "info" to "debug":
sed -i 's#info#debug#g' metafacture-runner/src/main/dist/config/log4j.xml 
# generate the distribution:
$ ./gradlew distZip; 
# change to the location to the flux.sh (assuming you have generated the distribution on "master" branch):
$ cd metafacture-runner/build/distributions/metafacture-core-master-SNAPSHOT-dist
$ bash  flux.sh $pathTo/your.flux

Note that you have to insert | log-stream into "$your.flux" after your morph or fix command. Output looks like:

DEBUG [main] [StreamLogger] start record 1
DEBUG [main] [StreamLogger] start entity author[]
DEBUG [main] [StreamLogger] start entity 1
DEBUG [main] [StreamLogger] literal @type=Person
DEBUG [main] [StreamLogger] literal name=Katja Königstein-Lüdersdorff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review
Development

No branches or pull requests

3 participants