Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Logging Best Practices

What are the some of best logging practices that we need to adopt

  
  
Posted 5 months ago
Votes Newest

Answers


@<1133362765067456512|User B> • When logging exceptions, it’s considered a best practice to log the exceptions along with the associated meta data - Account Nr, PolicyNr, Quote Number, etc. The meta data will prove invaluable when troubleshooting issues in production . • To go one step further, the meta data should be logged in the Name Value format. • Here is an example of logging an exception in Name Value pair format.

The underlined files represent Meta data that can be easily searched by a splunk query. In the statement given below, UID, CRID, PAN, PCN represent UserID, JobID, Account#, and Policy# respectively. Now it becomes ridiculously easy to scan the logs and identify ERRORs associated to a particular Job#, Policy # etc. file

An example of a splunk query that can quickly help zero in on the above entry is shown below. This SPLUNK query helps to narrow down the ERRORS associated to the Policy # = 1523669410. file

The strategy to implement this logging is pretty simple.

  1. Create a class named LogEntry that contains all the placeholders for data is required while logging. See a sample implementation.
  2. Then create a centralized logger Class (LoggerUtil) that has the methods (such as logInfo, logError, logTrace, logDebug etc) that take in LogEntry as a parameter

file

2
2
Posted 5 months ago
  
  

Thank You @<1117765784584589312|Sachin>

User B   5 months ago Report

Your answer

Attach file
Add
95 Views
1 Answer
5 months ago
5 months ago
Tags