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

[Merged by Bors] - Enable logging #298

Closed
wants to merge 38 commits into from
Closed

[Merged by Bors] - Enable logging #298

wants to merge 38 commits into from

Conversation

maltesander
Copy link
Member

@maltesander maltesander commented Jan 24, 2023

Description

  • Added log4j2 logging for Hive

If logging is set to DEBUG, there will be some exceptions due to null values in the XML string from DataNucleus.

ERROR StatusLogger com.fasterxml.jackson.core.JsonGenerationException: Invalid null character in text to output
 com.fasterxml.jackson.core.JsonGenerationException: Invalid null character in text to output
     at com.fasterxml.jackson.dataformat.xml.util.StaxUtil.throwAsGenerationException(StaxUtil.java:51)

Printed null values causing the problem (without XML format):

bash-4.4$ sed -n '/\x0/ { s/\x0/<NUL>/g; p}' /stackable/log/test.log
[DEBUG] 2023-01-20 13:33:24.637 [main] Transaction - Transaction created [DataNucleus Transaction, ID=Xid=<NUL><NUL><NUL>, enlisted resources=[]]
[DEBUG] 2023-01-20 13:33:24.647 [main] Transaction - Running enlist operation on resource: org.datanucleus.store.rdbms.ConnectionFactoryImpl$EmulatedXAResource@687e4c93, error code TMNOFLAGS and transaction: [DataNucleus Transaction, ID=Xid=<NUL><NUL><NUL>, enlisted resources=[]]
[DEBUG] 2023-01-20 13:33:24.647 [main] Connection - ManagedConnection(enlisted) "org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl@3b1ed14b [conn=com.zaxxer.hikari.pool.HikariProxyConnection@3727f0ee, commitOnRelease=false, closeOnRelease=false, closeOnTxnEnd=true]" starting for transaction "Xid=<NUL><NUL><NUL>" with flags "0"
[DEBUG] 2023-01-20 13:33:24.698 [main] Transaction - Committing [DataNucleus Transaction, ID=Xid=<NUL><NUL><NUL>, enlisted resources=[org.datanucleus.store.rdbms.ConnectionFactoryImpl$EmulatedXAResource@687e4c93]]
[DEBUG] 2023-01-20 13:33:24.698 [main] Connection - ManagedConnection(enlisted) 

TODO

  • Adapt image version in examples, docs, tests
  • Adapt changelog

fixes: #290

Review Checklist

  • Code contains useful comments
  • CRD change approved (or not applicable)
  • (Integration-)Test cases added (or not applicable)
  • Documentation added (or not applicable)
  • Changelog updated (or not applicable)
  • Cargo.toml only contains references to git tags (not specific commits or branches)
  • Helm chart can be installed and deployed operator works (or not applicable)

Once the review is done, comment bors r+ (or bors merge) to merge. Further information

@maltesander
Copy link
Member Author

maltesander commented Jan 25, 2023

@maltesander maltesander marked this pull request as ready for review January 25, 2023 16:35
CHANGELOG.md Outdated Show resolved Hide resolved
rust/operator-binary/src/product_logging.rs Show resolved Hide resolved
examples/simple-hive-cluster.yaml Outdated Show resolved Hide resolved
rust/crd/src/lib.rs Outdated Show resolved Hide resolved
rust/operator-binary/src/product_logging.rs Outdated Show resolved Hide resolved
rust/crd/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@siegfriedweber siegfriedweber left a comment

Choose a reason for hiding this comment

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

LGTM

@maltesander
Copy link
Member Author

bors merge

bors bot pushed a commit that referenced this pull request Jan 27, 2023
# Description

- Added log4j2 logging for Hive

If logging is set to DEBUG, there will be some exceptions due to null values in the XML string from `DataNucleus`.

```
ERROR StatusLogger com.fasterxml.jackson.core.JsonGenerationException: Invalid null character in text to output
 com.fasterxml.jackson.core.JsonGenerationException: Invalid null character in text to output
     at com.fasterxml.jackson.dataformat.xml.util.StaxUtil.throwAsGenerationException(StaxUtil.java:51)
```

Printed null values causing the problem (without XML format):
```
bash-4.4$ sed -n '/\x0/ { s/\x0/<NUL>/g; p}' /stackable/log/test.log
[DEBUG] 2023-01-20 13:33:24.637 [main] Transaction - Transaction created [DataNucleus Transaction, ID=Xid=<NUL><NUL><NUL>, enlisted resources=[]]
[DEBUG] 2023-01-20 13:33:24.647 [main] Transaction - Running enlist operation on resource: org.datanucleus.store.rdbms.ConnectionFactoryImpl$EmulatedXAResource@687e4c93, error code TMNOFLAGS and transaction: [DataNucleus Transaction, ID=Xid=<NUL><NUL><NUL>, enlisted resources=[]]
[DEBUG] 2023-01-20 13:33:24.647 [main] Connection - ManagedConnection(enlisted) "org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl@3b1ed14b [conn=com.zaxxer.hikari.pool.HikariProxyConnection@3727f0ee, commitOnRelease=false, closeOnRelease=false, closeOnTxnEnd=true]" starting for transaction "Xid=<NUL><NUL><NUL>" with flags "0"
[DEBUG] 2023-01-20 13:33:24.698 [main] Transaction - Committing [DataNucleus Transaction, ID=Xid=<NUL><NUL><NUL>, enlisted resources=[org.datanucleus.store.rdbms.ConnectionFactoryImpl$EmulatedXAResource@687e4c93]]
[DEBUG] 2023-01-20 13:33:24.698 [main] Connection - ManagedConnection(enlisted) 
```
## TODO

- [x] Adapt image version in examples, docs, tests 
- [x] Adapt changelog

fixes: #290



Co-authored-by: Malte Sander <malte.sander.it@gmail.com>
Co-authored-by: Siegfried Weber <mail@siegfriedweber.net>
@bors
Copy link
Contributor

bors bot commented Jan 27, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Enable logging [Merged by Bors] - Enable logging Jan 27, 2023
@bors bors bot closed this Jan 27, 2023
@bors bors bot deleted the enable-logging branch January 27, 2023 16:28
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.

Enable Log Aggregation for Hive
2 participants