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 · 12 comments
Open

Add option to runner for enabling DEBUG Mode #536

TobiasNx opened this issue Jun 18, 2024 · 12 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

@TobiasNx
Copy link
Contributor Author

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

@dr0i So I wont be able to change the debug status AFTER the dist creation? If I change the following xml? metafacture-runner/build/install/metafacture-core/config/log4j.xml

@dr0i
Copy link
Member

dr0i commented Nov 19, 2024

So I wont be able to change the debug status AFTER the dist creation? If I change the following xml? metafacture-runner/build/install/metafacture-core/config/log4j.xml

To be 100% sure one has to try that out. Let me know the result.

@TobiasNx TobiasNx assigned dr0i and unassigned TobiasNx Nov 20, 2024
@TobiasNx
Copy link
Contributor Author

I tested it you only have to change the value in metafacture-runner/build/install/metafacture-core/config/log4j.xml the file in src is just copied when the dist is created.

@dr0i
Copy link
Member

dr0i commented Nov 21, 2024

the file in src is just copied when the dist is created.

Does that mean that even AFTER doing $ ./gradlew distZip one can change the llog level?
Btw I am not sure why I was assigned here.

@TobiasNx
Copy link
Contributor Author

the file in src is just copied when the dist is created.

Does that mean that even AFTER doing $ ./gradlew distZip one can change the llog level? Btw I am not sure why I was assigned here.

Yes you can change it afterwards, so e.g. the released core distributions are configurable with regard to the release: https://github.com/metafacture/metafacture-core/releases/tag/metafacture-core-6.1.2

@dr0i dr0i assigned TobiasNx and unassigned dr0i Nov 21, 2024
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