Logs
The FP logging example returns a new log list for each appended message instead of mutating in place. The OOP logging example uses a mutable log list with methods to add and retrieve entries. Request IDs allow log entries to be joined with…
2 sources - 9 claims
The FP logging example returns a new log list for each appended message instead of mutating in place. The OOP logging example uses a mutable log list with methods to add and retrieve entries. Request IDs allow log entries to be joined with traces. Logs should be structured, queryable, and associated with requests. JSON is presented as the standard format for machine-queryable logs. OOP logging is not inherently thread-safe because multiple threads can modify the log list unpredictably. Unstructured large log dumps have little value when teams cannot search them. FP logging can use more memory because every log call allocates a new list. OOP logging is useful for systems that need log persistence such as monitoring tools.