Skip to content

Commit 111ba96

Browse files
fix(23639): add hiero logger (#23649) (#23883)
Signed-off-by: mxtartaglia <maxi@swirldslabs.com> Co-authored-by: Andrew Brandt <andrew.brandt@hashgraph.com>
1 parent 648f2ee commit 111ba96

9 files changed

Lines changed: 990 additions & 0 deletions

File tree

.github/workflows/support/citr/log4j2.xml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,118 @@
206206
</Filters>
207207
</Logger>
208208

209+
<Logger name="org.hiero" level="INFO" additivity="false">
210+
<AppenderRef ref="fileLog">
211+
<Filters>
212+
<!-- MerkleDb & Virtual Merkle -->
213+
<MarkerFilter marker="MERKLE_DB" onMatch="DENY" onMismatch="NEUTRAL"/>
214+
<MarkerFilter marker="VIRTUAL_MERKLE_STATS" onMatch="DENY" onMismatch="NEUTRAL"/>
215+
<MarkerFilter marker="STATE_HASH" onMatch="DENY" onMismatch="NEUTRAL"/>
216+
</Filters>
217+
</AppenderRef>
218+
219+
<AppenderRef ref="vMapLog">
220+
<Filters>
221+
<!-- MerkleDb & Virtual Merkle -->
222+
<MarkerFilter marker="MERKLE_DB" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
223+
<MarkerFilter marker="VIRTUAL_MERKLE_STATS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
224+
<MarkerFilter marker="DISABLED" onMatch="DENY" onMismatch="DENY" />
225+
</Filters>
226+
</AppenderRef>
227+
228+
<AppenderRef ref="swirldsHashStream">
229+
<Filters>
230+
<!-- Hash stream log -->
231+
<MarkerFilter marker="STATE_HASH" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
232+
<MarkerFilter marker="DISABLED" onMatch="DENY" onMismatch="DENY" />
233+
</Filters>
234+
</AppenderRef>
235+
236+
<!--
237+
Due to known log4j2 issues with how Markers and LogLevels are evaluated there must be a top level <Filter> element
238+
to ensure that the root logger does not execute all the lambda arguments erroneously. Potential work around in the
239+
future is to use a top-level <Filter> and <Logger> specific filters in combination to achieve the desired
240+
multi-logger setup for diagnostic logging.
241+
-->
242+
<Filters>
243+
<!-- Filter out levels above INFO (ex: DEBUG & TRACE) -->
244+
<!-- Intentionally left disabled by default -->
245+
<!-- <ThresholdFilter level="INFO" onMatch="NEUTRAL" onMismatch="DENY" />-->
246+
247+
<!-- In the following, enable a marker with onMatch="ACCEPT" and disable with onMatch="DENY". -->
248+
<!-- More markers can be added, but ensure that every onMismatch="NEUTRAL", except the last is "DENY". -->
249+
250+
<!-- Exceptions -->
251+
<MarkerFilter marker="EXCEPTION" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
252+
<MarkerFilter marker="TESTING_EXCEPTIONS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
253+
<MarkerFilter marker="SOCKET_EXCEPTIONS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
254+
<MarkerFilter marker="TCP_CONNECT_EXCEPTIONS" onMatch="DENY" onMismatch="NEUTRAL"/>
255+
256+
<!-- Errors -->
257+
<MarkerFilter marker="INVALID_EVENT_ERROR" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
258+
259+
<!-- Synchronization/Gossip (Debug) -->
260+
<MarkerFilter marker="SYNC_START" onMatch="DENY" onMismatch="NEUTRAL"/>
261+
<MarkerFilter marker="SYNC_DONE" onMatch="DENY" onMismatch="NEUTRAL"/>
262+
<MarkerFilter marker="SYNC_ERROR" onMatch="DENY" onMismatch="NEUTRAL"/>
263+
<MarkerFilter marker="SYNC" onMatch="DENY" onMismatch="NEUTRAL"/>
264+
<MarkerFilter marker="HEARTBEAT" onMatch="DENY" onMismatch="NEUTRAL"/>
265+
266+
<!-- Platform Events (Debug) -->
267+
<MarkerFilter marker="CREATE_EVENT" onMatch="DENY" onMismatch="NEUTRAL"/>
268+
<MarkerFilter marker="INTAKE_EVENT" onMatch="DENY" onMismatch="NEUTRAL"/>
269+
<MarkerFilter marker="WATCH_EVENTS_SEND_REC" onMatch="DENY" onMismatch="NEUTRAL"/>
270+
<MarkerFilter marker="EVENT_SIG" onMatch="DENY" onMismatch="NEUTRAL"/>
271+
<MarkerFilter marker="EVENT_STREAM" onMatch="DENY" onMismatch="NEUTRAL"/>
272+
<MarkerFilter marker="EVENT_RESTART" onMatch="DENY" onMismatch="NEUTRAL"/>
273+
<MarkerFilter marker="STALE_EVENTS" onMatch="DENY" onMismatch="NEUTRAL"/>
274+
<MarkerFilter marker="EVENT_PARSER" onMatch="DENY" onMismatch="NEUTRAL"/>
275+
<MarkerFilter marker="EVENT_CONTENT" onMatch="DENY" onMismatch="NEUTRAL"/>
276+
277+
<!-- Queues/Certificates/Utilities -->
278+
<MarkerFilter marker="QUEUES" onMatch="DENY" onMismatch="NEUTRAL"/>
279+
<MarkerFilter marker="CERTIFICATES" onMatch="DENY" onMismatch="NEUTRAL"/>
280+
<MarkerFilter marker="LOCKS" onMatch="DENY" onMismatch="NEUTRAL"/>
281+
<MarkerFilter marker="TIME_MEASURE" onMatch="DENY" onMismatch="NEUTRAL"/>
282+
<MarkerFilter marker="THREADS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
283+
284+
<!-- Signed State Signatures -->
285+
<MarkerFilter marker="STATE_SIG_DIST" onMatch="DENY" onMismatch="NEUTRAL"/>
286+
<MarkerFilter marker="STATE_DELETER" onMatch="DENY" onMismatch="NEUTRAL"/>
287+
<MarkerFilter marker="OBJECT_STREAM_DETAIL" onMatch="DENY" onMismatch="NEUTRAL"/>
288+
289+
<!-- Cryptography -->
290+
<MarkerFilter marker="OPENCL_INIT_EXCEPTIONS" onMatch="DENY" onMismatch="NEUTRAL"/>
291+
<MarkerFilter marker="ADV_CRYPTO_SYSTEM" onMatch="DENY" onMismatch="NEUTRAL"/>
292+
293+
<!-- Startup/Restart/Reconnect -->
294+
<MarkerFilter marker="STARTUP" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
295+
<MarkerFilter marker="PLATFORM_STATUS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
296+
<MarkerFilter marker="RECONNECT" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
297+
<MarkerFilter marker="FREEZE" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
298+
299+
<!-- Saved States -->
300+
<MarkerFilter marker="SNAPSHOT_MANAGER" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
301+
<MarkerFilter marker="STATE_TO_DISK" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
302+
<MarkerFilter marker="STATE_HASH" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
303+
304+
<!-- Beta Mirror -->
305+
<MarkerFilter marker="BETA_MIRROR_NODE" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
306+
307+
<!-- Merkle Trees & Hashing -->
308+
<MarkerFilter marker="MERKLE_FORCE_FLUSH" onMatch="DENY" onMismatch="NEUTRAL"/>
309+
<MarkerFilter marker="MERKLE_HASHING" onMatch="DENY" onMismatch="NEUTRAL"/>
310+
<MarkerFilter marker="MERKLE_GENERATION" onMatch="DENY" onMismatch="NEUTRAL"/>
311+
<MarkerFilter marker="MERKLE_LOCKS" onMatch="DENY" onMismatch="NEUTRAL"/>
312+
313+
<!-- MerkleDb & Virtual Merkle -->
314+
<MarkerFilter marker="MERKLE_DB" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
315+
<MarkerFilter marker="VIRTUAL_MERKLE_STATS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
316+
317+
<MarkerFilter marker="DISABLED" onMatch="DENY" onMismatch="DENY" />
318+
</Filters>
319+
</Logger>
320+
209321
<!-- Send transaction state logs to their own appender -->
210322
<Logger name="com.hedera.node.app.state.logging.TransactionStateLogger" level="info" additivity="false">
211323
<AppenderRef ref="TransactionStateLogs"/>

hedera-node/configuration/compose/log4j2.xml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,118 @@
204204
</Filters>
205205
</Logger>
206206

207+
<Logger name="org.hiero" level="INFO" additivity="false">
208+
<AppenderRef ref="fileLog">
209+
<Filters>
210+
<!-- MerkleDb & Virtual Merkle -->
211+
<MarkerFilter marker="MERKLE_DB" onMatch="DENY" onMismatch="NEUTRAL"/>
212+
<MarkerFilter marker="VIRTUAL_MERKLE_STATS" onMatch="DENY" onMismatch="NEUTRAL"/>
213+
<MarkerFilter marker="STATE_HASH" onMatch="DENY" onMismatch="NEUTRAL"/>
214+
</Filters>
215+
</AppenderRef>
216+
217+
<AppenderRef ref="vMapLog">
218+
<Filters>
219+
<!-- MerkleDb & Virtual Merkle -->
220+
<MarkerFilter marker="MERKLE_DB" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
221+
<MarkerFilter marker="VIRTUAL_MERKLE_STATS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
222+
<MarkerFilter marker="DISABLED" onMatch="DENY" onMismatch="DENY" />
223+
</Filters>
224+
</AppenderRef>
225+
226+
<AppenderRef ref="swirldsHashStream">
227+
<Filters>
228+
<!-- Hash stream log -->
229+
<MarkerFilter marker="STATE_HASH" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
230+
<MarkerFilter marker="DISABLED" onMatch="DENY" onMismatch="DENY" />
231+
</Filters>
232+
</AppenderRef>
233+
234+
<!--
235+
Due to known log4j2 issues with how Markers and LogLevels are evaluated there must be a top level <Filter> element
236+
to ensure that the root logger does not execute all the lambda arguments erroneously. Potential work around in the
237+
future is to use a top-level <Filter> and <Logger> specific filters in combination to achieve the desired
238+
multi-logger setup for diagnostic logging.
239+
-->
240+
<Filters>
241+
<!-- Filter out levels above INFO (ex: DEBUG & TRACE) -->
242+
<!-- Intentionally left disabled by default -->
243+
<!-- <ThresholdFilter level="INFO" onMatch="NEUTRAL" onMismatch="DENY" />-->
244+
245+
<!-- In the following, enable a marker with onMatch="ACCEPT" and disable with onMatch="DENY". -->
246+
<!-- More markers can be added, but ensure that every onMismatch="NEUTRAL", except the last is "DENY". -->
247+
248+
<!-- Exceptions -->
249+
<MarkerFilter marker="EXCEPTION" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
250+
<MarkerFilter marker="TESTING_EXCEPTIONS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
251+
<MarkerFilter marker="SOCKET_EXCEPTIONS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
252+
<MarkerFilter marker="TCP_CONNECT_EXCEPTIONS" onMatch="DENY" onMismatch="NEUTRAL"/>
253+
254+
<!-- Errors -->
255+
<MarkerFilter marker="INVALID_EVENT_ERROR" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
256+
257+
<!-- Synchronization/Gossip (Debug) -->
258+
<MarkerFilter marker="SYNC_START" onMatch="DENY" onMismatch="NEUTRAL"/>
259+
<MarkerFilter marker="SYNC_DONE" onMatch="DENY" onMismatch="NEUTRAL"/>
260+
<MarkerFilter marker="SYNC_ERROR" onMatch="DENY" onMismatch="NEUTRAL"/>
261+
<MarkerFilter marker="SYNC" onMatch="DENY" onMismatch="NEUTRAL"/>
262+
<MarkerFilter marker="HEARTBEAT" onMatch="DENY" onMismatch="NEUTRAL"/>
263+
264+
<!-- Platform Events (Debug) -->
265+
<MarkerFilter marker="CREATE_EVENT" onMatch="DENY" onMismatch="NEUTRAL"/>
266+
<MarkerFilter marker="INTAKE_EVENT" onMatch="DENY" onMismatch="NEUTRAL"/>
267+
<MarkerFilter marker="WATCH_EVENTS_SEND_REC" onMatch="DENY" onMismatch="NEUTRAL"/>
268+
<MarkerFilter marker="EVENT_SIG" onMatch="DENY" onMismatch="NEUTRAL"/>
269+
<MarkerFilter marker="EVENT_STREAM" onMatch="DENY" onMismatch="NEUTRAL"/>
270+
<MarkerFilter marker="EVENT_RESTART" onMatch="DENY" onMismatch="NEUTRAL"/>
271+
<MarkerFilter marker="STALE_EVENTS" onMatch="DENY" onMismatch="NEUTRAL"/>
272+
<MarkerFilter marker="EVENT_PARSER" onMatch="DENY" onMismatch="NEUTRAL"/>
273+
<MarkerFilter marker="EVENT_CONTENT" onMatch="DENY" onMismatch="NEUTRAL"/>
274+
275+
<!-- Queues/Certificates/Utilities -->
276+
<MarkerFilter marker="QUEUES" onMatch="DENY" onMismatch="NEUTRAL"/>
277+
<MarkerFilter marker="CERTIFICATES" onMatch="DENY" onMismatch="NEUTRAL"/>
278+
<MarkerFilter marker="LOCKS" onMatch="DENY" onMismatch="NEUTRAL"/>
279+
<MarkerFilter marker="TIME_MEASURE" onMatch="DENY" onMismatch="NEUTRAL"/>
280+
<MarkerFilter marker="THREADS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
281+
282+
<!-- Signed State Signatures -->
283+
<MarkerFilter marker="STATE_SIG_DIST" onMatch="DENY" onMismatch="NEUTRAL"/>
284+
<MarkerFilter marker="STATE_DELETER" onMatch="DENY" onMismatch="NEUTRAL"/>
285+
<MarkerFilter marker="OBJECT_STREAM_DETAIL" onMatch="DENY" onMismatch="NEUTRAL"/>
286+
287+
<!-- Cryptography -->
288+
<MarkerFilter marker="OPENCL_INIT_EXCEPTIONS" onMatch="DENY" onMismatch="NEUTRAL"/>
289+
<MarkerFilter marker="ADV_CRYPTO_SYSTEM" onMatch="DENY" onMismatch="NEUTRAL"/>
290+
291+
<!-- Startup/Restart/Reconnect -->
292+
<MarkerFilter marker="STARTUP" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
293+
<MarkerFilter marker="PLATFORM_STATUS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
294+
<MarkerFilter marker="RECONNECT" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
295+
<MarkerFilter marker="FREEZE" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
296+
297+
<!-- Saved States -->
298+
<MarkerFilter marker="SNAPSHOT_MANAGER" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
299+
<MarkerFilter marker="STATE_TO_DISK" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
300+
<MarkerFilter marker="STATE_HASH" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
301+
302+
<!-- Beta Mirror -->
303+
<MarkerFilter marker="BETA_MIRROR_NODE" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
304+
305+
<!-- Merkle Trees & Hashing -->
306+
<MarkerFilter marker="MERKLE_FORCE_FLUSH" onMatch="DENY" onMismatch="NEUTRAL"/>
307+
<MarkerFilter marker="MERKLE_HASHING" onMatch="DENY" onMismatch="NEUTRAL"/>
308+
<MarkerFilter marker="MERKLE_GENERATION" onMatch="DENY" onMismatch="NEUTRAL"/>
309+
<MarkerFilter marker="MERKLE_LOCKS" onMatch="DENY" onMismatch="NEUTRAL"/>
310+
311+
<!-- MerkleDb & Virtual Merkle -->
312+
<MarkerFilter marker="MERKLE_DB" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
313+
<MarkerFilter marker="VIRTUAL_MERKLE_STATS" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
314+
315+
<MarkerFilter marker="DISABLED" onMatch="DENY" onMismatch="DENY" />
316+
</Filters>
317+
</Logger>
318+
207319
<!-- Send transaction state logs to their own appender -->
208320
<Logger name="com.hedera.node.app.state.logging.TransactionStateLogger" level="info" additivity="false">
209321
<AppenderRef ref="TransactionStateLogs"/>

0 commit comments

Comments
 (0)