-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Allow log configuration #414
Comments
Hi @midopa I think it is impossible to make that AppiumServiceBuilder builder = new AppiumServiceBuilder();
// console will only output warning and above level logs
builder.withArgument(GeneralServerFlag.LOG_LEVEL, "warn");
// a log file will be created for all info and above level logs
builder.withLogFile(myLogFile, "info");
// this will use the current logging level, either default or the user-set LOG_LEVEL argument
builder.withLogFile(myLogFile); This string manages the output log level of the server and client doesn't do anything with it. builder.withArgument(GeneralServerFlag.LOG_LEVEL, "warn"); Server has it is own logger so that is why your log4j2 config is not picked up. and use cases: I think it is possible to to re-use the same output stream as log4j2 uses and filter log messages there. |
Thanks! That's very close to what I'd like. Would it be possible to expose an API that would give me a bit more control? In my case, I just want to clear out the existing streams so nothing goes to the console. Or maybe a different ctor/builder API for that? |
@midopa |
This is solved by #1014 |
Description
I set Appium's log level to warn so my console output is decluttered. But when I want to debug an issue, I have to set it to info. I'd like to have the best of both worlds without having to rerun my tests. IOW, I'd like the console to only output warning level messages and above and I'd like a file log with verbose logging.
For this reason, I would like the ability to configure Appium's logging. Maybe with a logging properties file?
If I use the
builder.withLogFile(File)
API, this doesn't suppress logging to the console.I use log4j2. I've tried using logging bridges (Java util logging, Commons Util, and log4j1), but my logging configuration isn't being picked up.
Environment
Code To Reproduce Issue
Current code:
Desired:
The text was updated successfully, but these errors were encountered: