Combining -json and -logFile yields no logFile
See original GitHub issueWhich version and edition of Flyway are you using?
6.1.0
If this is not the latest version, can you reproduce the issue with the latest one as well?
(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Command-line
Which database are you using (type & version)?
MSSQL 2017 CU17 in Docker
Which operating system are you using?
MacOS
What did you do?
(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.) flyway info -json -logFile=“test”
What did you expect to see?
A test file created with JSON formatting of the output
What did you see instead?
Nothing. -json
and -logFile
function independently, but they do not function together. Instead, JSON formatting is printed to standard out, but the log file is not created.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Running nerdctl compose up immediately exists with "no such ...
Running nerdctl compose up (without the -d detach flag) immediately exits with an error that the container -json.log file does not exist.
Read more >Python logging into file as a dictionary or JSON - Stack Overflow
I understand that I can post process this log file after my process is finished, but I am looking for a more elegant...
Read more >JSON Logging: What, Why, How, & Tips - Coralogix
As a log analysis and observability platform, Coralogix automatically extracts fields from your JSON logs so that you can filter, sort, query, ...
Read more >Structured Greping Of Structured Logging - Rethink, Rewrite.
Whenever an event takes place within an Ad Exchange we write a JSON object into a log file containing all the metadata about...
Read more >How to Collect, Customize, and Analyze PHP Logs - Datadog
When you use a specialized tool to tail your log file and forward your ... To make it easy to create JSON logs...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK, we’ve discussed and the conclusion we’ve come to is:
-outputFile
in preference to-logFile
(though the latter will persist as a deprecated, undocumented option for people who picked it up early, at least for now)-json
is turned on, you get nothing but the JSON object as output (a fatal error being part of the object).-X
doesn’t change this.-outputFile
is turned on, the output file gets a verbatim copy of the console output regardless of-json
Another thing is that
-q
should suppress output (apart for warnings and errors) from both the console and the file. However, all command-line options that set log level (namely-q
and-X
) should be ignored when-json
is specified.