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.

Making SingleFieldAppendingMarker#getFieldValue() package-private broke log assertions

See original GitHub issue

Description

I am maintaining https://github.com/dm-drogeriemarkt/log-capture/ which we use to test our logging.

I also allows to assert logging of keyValue, see https://github.com/dm-drogeriemarkt/log-capture/#key-value-from-logstash

Making SingleFieldAppendingMarker#getFieldValue() package-private broke that for me, because I used it for those assertions. I don’t see a viable replacement, although I might be overlooking something.

Expected behavior

I am aware that is kind of a https://xkcd.com/1172/ situation 😉, but I would like a way to be still able to use those assertions. If everything else fails, I can mis-use toStringSelf() and filter out the key, but I’d rather not do that.

  • logstash-logback-encoder 7.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
waschmittelcommented, Apr 14, 2022

Fwiw, we also need the actual value and not JSON for our assertions @philsttr, since the whole point of those assertions is that they are based on content and should work regardless of log formatting/encoding.

So I would also be happy if there was a way to get to the contents.

0reactions
github-actions[bot]commented, Oct 11, 2022

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Broken usage of capsys for inspecting logging output #8622
What happened: We have one unit test that uses capsys to make assertions about emitted logs: dask/dataframe/io/tests/test_sql.py Add a ...
Read more >
How to do a JUnit assert on a message in a logger
Basically, you create your own Appender and add it to the logger you ... Assert.assertThat; public class MyTest { @Test public void test()...
Read more >
Kohi #003: Logging and Assertions (Kohi Vulkan ... - YouTube
Kohi #003: Logging and Assertions (Kohi Vulkan Game Engine Serie... ... is part of a series where we make a game engine in...
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