[JAVA-4962] Add interpolation to unstructured logging Created: 11/May/23 Updated: 25/May/23 Resolved: 25/May/23 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Logging |
| Affects Version/s: | None |
| Fix Version/s: | 4.10.0 |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Slav Babanin | Assignee: | Slav Babanin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||
| Description |
|
The conditional logging statements can become quite cumbersome. As alternative, we could use special formatting similar to SLF4j but extended for our needs. This new format could use }} placeholders for values and {{[] placeholders for conditionals. We could enclose parts of the sentences within conditionals like [ with service-id {}], meaning that if the value is null, the entire sentence within brackets would be omitted. |