question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Combining -json and -logFile yields no logFile

See original GitHub issue
Which 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:closed
  • Created 4 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
juliahaywardcommented, Dec 11, 2019

OK, we’ve discussed and the conclusion we’ve come to is:

  • use -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)
  • when -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.
  • when -outputFile is turned on, the output file gets a verbatim copy of the console output regardless of -json
0reactions
alextercetecommented, Dec 12, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found