Logging Flashcards

1
Q

Can you discuss the key components of a well-structured log message?

A
  • timestamp
  • log level
  • source identifier
  • log message
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you ensure that log messages are both informative and actionable for identifying issues quickly?

A
  1. Be concise
  2. Follow a standard
  3. Correlate across services using a transaction ID
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How would you approach designing a centralized logging system that aggregates logs from different services?

A
  1. Use the appropriate tool (ELK or cloud-native)
  2. Configure microservices to configured to ship logs to a central repository
  3. Use log aggregation and indexing to search and correlate logs
  4. Look at sharding and scaling techniques
  5. manage indexing settings and optimize queries
  6. consider log sampling for high-traffic services
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you ensure proper handling of sensitive data in logs to comply with security and privacy regulations?

A
  1. avoid logging sensitive information
  2. use log masking
  3. use token redaction
  4. regularly audit log configurations
  5. create automated checks to maintain compliance with privacy regulations
  6. implement access controls to limit log access
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Can you describe techniques like log masking and token redaction that are used to strike a balance between logging visibility and data protection?

A
  • log masking: sensitive values are replaced with placeholders or hashed representations
  • token redaction: omitting sensitive data from logs while maintaining a reference to the token for debugging purposes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How would you manage log retention and storage effectively?

A
  1. balancing act between analysis needs and storage costs
  2. configure log rotation settings based on time or size thresholds
  3. automatically compress and archive older logs
  4. implement tiered storage approach (recent logs are stored in high-performance storage and older logs in cost-effective storage tiers)
  5. review retention policies and collaborate with stakeholders
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s the difference between events and structured logs?

A
  • events describe a unit of work
  • events contain all of the information about what it took for a service to perform a certain job
  • logs are only portions of events
  • a group of logs can compose a single event
  • an event is a conceptual abstraction and a structured log is one possible representation of that abstraction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a log?

A
  • a collection of messages
  • written to disk
  • sometimes streamed
  • line-delimited
  • messages may or may not be related to each other
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a structured log?

A
  • all the characteristics of Log
  • represented using a structured format (key/value pairs)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is an event?

A

An event contains information about what it took for a service to perform a unit of work

How well did you know this?
1
Not at all
2
3
4
5
Perfectly