IT Glossary
Logging: what it is and how to do it right
Logging is the automatic, timestamped recording of events in an application or server (sign-ins, errors, payments, data access) into log files, used for troubleshooting, audit and security investigation.
- 7
- sections
- 5
- questions answered
In IT, logging means each program writes, for every important event, one line with the exact time, a severity level, the component that produced it and what happened, for example “2026-11-18T14:30:12Z ERROR payments: payment 4812 declined by processor, card expired”. When a customer says “the payment failed yesterday”, the log is the difference between a documented answer in ten minutes and a week of guessing. Like an aircraft flight recorder, it prevents nothing, but without it nobody learns what happened.
Logging is the continuous writing of events as the software runs: a user signed in, an order was created, a payment provider returned an error, a request took eleven seconds. Each entry carries a time, a severity and, when the design is good, an identifier that lets one customer transaction be followed across every system it touched. Three business needs draw on that record. Support answers the disputed complaint with what actually happened. Auditors and regulators ask who accessed which personal data and when, and an unanswerable question is itself a finding. Security investigations depend entirely on the trail, because an intrusion is almost always discovered after the fact. The two failure modes are equally common: keeping nothing, so the answers do not exist, and keeping everything indefinitely including passwords and personal data, which turns your logs into the most attractive target on the network. Logs are also the raw material for monitoring, not a synonym of it.
Why it matters for your business
Complaints resolved with evidence
A timestamped record settles what happened to an order or a payment, replacing an argument between two confident recollections.
Compliance demonstrable at audit
Access to personal data, administrative actions and system changes are traceable, which is what data protection audits actually ask for.
Attacks that leave visible traces
Centralised, tamper-resistant logs are what makes an intrusion detectable and its scope determinable rather than merely suspected.
What a log entry contains
An entry usually has six elements: the time (preferably UTC, ISO 8601, with the time zone), the severity level, the source (service or component), the message, a request or correlation ID that lets one transaction be followed across all systems, and, where justified, the user or IP address.
Free text is easy for a person to read but hard to search automatically. A structured format (for example JSON, with separate fields) can be filtered and aggregated in a central system. By content, logs are application or error logs, access or audit logs (who did what), and system or security logs.
Logging levels
The usual order, from most detailed to most severe, is TRACE (found in Java libraries such as Log4j and SLF4J), DEBUG, INFO, WARNING, ERROR and CRITICAL or FATAL. Python's standard library numbers them DEBUG 10, INFO 20, WARNING 30, ERROR 40, CRITICAL 50, and the root logger defaults to WARNING.
The syslog standard (RFC 5424) uses the reverse scale, from 0 Emergency to 7 Debug. Production usually runs at INFO, with DEBUG switched on temporarily for an investigation.
Want an estimate for your project?
Message us on WhatsApp. We reply the same working day, and the first 30-minute call is free.
Logging, monitoring and tracing
The three complement each other. Logs are individual events and answer “why”; metrics are numbers over time and answer “how much”; traces follow a single request across several services and answer “where”. Logs often go to ELK or OpenSearch, Grafana Loki or Graylog; metrics to Prometheus or Zabbix; traces to OpenTelemetry or Jaeger.
What DNSC, NIS2 and GDPR ask of logs
No general rule obliges every company to keep logs, but several texts require or assume them. Emergency Ordinance 155/2024 transposes the NIS2 directive in Romania, and on 14.05.2026 the national cybersecurity directorate (DNSC) published the guide “Best practices for drawing up an information logging policy”. Which companies fall under NIS2 is decided by OUG 155/2024 and DNSC, not by this page.
For digital providers (DNS, cloud, data centres, managed services, online marketplaces and similar), Implementing Regulation (EU) 2024/2690, annex 3.2, requires logs that include, where appropriate, authentication events, user creation and changes, privilege expansion, privileged activity, changes to critical configuration and backups, and the start and stop of logging. Logs are kept for a predefined period, protected from change and time-synchronised.
GDPR applies to logs that hold personal data: storage limitation (art. 5(1)(e)) and security of processing (art. 32). The OWASP Top 10 2025 lists “A09 Security Logging and Alerting Failures”, meaning missing or weak security logging and alerting. The OWASP logging guidance says not to write passwords, session identifiers, tokens, keys or card data into logs.
Other meanings of the Romanian word “jurnalizare”
The Romanian word has several senses. In journaling file systems (ext4, NTFS), intended changes are written to a journal first and applied afterwards, so a power cut does not corrupt the disk. In accounting, it is the chronological recording of operations in the general journal and the sales and purchase journals. In the personal sense, a journal is a notebook for reflection. This page covers the IT sense.
Frequently asked questions
What logging levels exist and how are they used?
Conventionally five: debug for development detail, info for normal business events, warning for recoverable anomalies, error for failed operations, and critical or fatal for a system that cannot continue. Production usually runs at info with the ability to raise the level temporarily during an investigation. Logging everything at debug permanently is expensive and, paradoxically, makes finding the important entry harder.
How long should logs be retained?
Match the period to the purpose rather than to storage cost. Operational troubleshooting rarely needs more than thirty to ninety days at full detail. Security investigation benefits from six to twelve months, since intrusions are often discovered late. Financial and audit trails may be required for years by sector rules. Where logs contain personal data, GDPR requires a defined retention period and its enforcement, not indefinite accumulation.
Are logs allowed to contain personal data or passwords?
Passwords, card numbers, full tokens and health data must never be written to a log, and the frequent cause of leaks is an error handler dumping an entire request. Personal data may appear where it is necessary and justified, but then the logs inherit every GDPR obligation: lawful basis, retention limits, access control and inclusion in your processing records. Mask by default and log identifiers instead of contents.
Is logging mandatory for a company in Romania?
Not through a general rule for every company. It is explicitly required of NIS2 entities (OUG 155/2024; for digital providers, Regulation (EU) 2024/2690, annex 3.2), and GDPR requires security and storage limitation for personal data in logs. For other companies, the DNSC guide of 14.05.2026 is the best-practice reference.
Where are an application's logs stored?
Small systems keep local files with rotation. Once there is more than one server, use a central system (ELK or OpenSearch, Loki, Graylog or the cloud provider's logging service). Keep the protected copy separate from the server producing it, so an attacker cannot erase their own traces; a SIEM correlates security events.
Let’s talk about your project
Book a free 30-minute call or send us an email. We reply the same working day.
office@northdan.com · +40 750 252 851