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

extra logging first draft #836

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

borkabu
Copy link

@borkabu borkabu commented Jun 29, 2024

Fixes #824
Added new configuration setting FieldValidationLogging.
When it is Y, then prints log messages instead of failing validation for unknown user defined fields, unknown fields and unknown enum values.

Copy link
Member

@chrjohn chrjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrjohn
Copy link
Member

chrjohn commented Jul 1, 2024

I'm still thinking about a better way to do the logging. As it is now there is no correlation to the actual message and it could be hard to see which message is actually affected. Maybe we could do this via the sessions's log? But still thinking about how this could be accomplished.

@borkabu
Copy link
Author

borkabu commented Jul 1, 2024

Updated documentation

@borkabu
Copy link
Author

borkabu commented Jul 1, 2024

I'm still thinking about a better way to do the logging. As it is now there is no correlation to the actual message and it could be hard to see which message is actually affected. Maybe we could do this via the sessions's log? But still thinking about how this could be accomplished.

If I understand correctly, DataDictionary is independent of Session. Validation of message can be done, without having existing Session. I see no obstacles of printing message related information. In my case, this logging is to warn about schema being out of sync, so message itself is not really important.

@philipwhiuk
Copy link
Contributor

philipwhiuk commented Sep 13, 2024

If I understand correctly, DataDictionary is independent of Session. Validation of message can be done, without having existing Session. I see no obstacles of printing message related information. In my case, this logging is to warn about schema being out of sync, so message itself is not really important.

But if you have lots of sessions it's necessary to identify which counter-party is sending out-of-spec messages. Doing it this way you'll have to go back and find the message in the log in a separate log line. That's terrible.

A nicer way might be a callback:

Something a little like:

onOutOfSpecMessage(Message m, int tag, String value);

then at least the app can decide to look it up from the Message.

You can implement a pure logging handler if that's all you need.

@borkabu
Copy link
Author

borkabu commented Oct 25, 2024

If I understand correctly, DataDictionary is independent of Session. Validation of message can be done, without having existing Session. I see no obstacles of printing message related information. In my case, this logging is to warn about schema being out of sync, so message itself is not really important.

But if you have lots of sessions it's necessary to identify which counter-party is sending out-of-spec messages. Doing it this way you'll have to go back and find the message in the log in a separate log line. That's terrible.

A nicer way might be a callback:

Something a little like:

onOutOfSpecMessage(Message m, int tag, String value);

then at least the app can decide to look it up from the Message.

You can implement a pure logging handler if that's all you need.

I have kind of warmed up to an idea of callback. I see there would be a default callback with a default logger, when validation is used outside of a session and "integrated" session callback with session logger, when validation is inside session.

@borkabu borkabu requested a review from chrjohn October 28, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extra logging for fields when validation is disabled
3 participants