Skip to content
Law & compliance

Customer data in integration logs: what may be kept

Customer data in integration logs: which fields debugging needs, how to mask them and how to set separate retention for logs and the dead-letter queue.

21 min read DSGVOMiddlewareProtokollierungDatenschutz

In short and in plain language

A shop sends orders to other programs. The system often writes each message in full into a log. Then the log holds names, addresses and bank data.

To find errors, much less is enough. What counts is the order number, the time and the error. Names and addresses can be left out or hidden.

Messages with errors sit in a store of their own. This store also needs a rule for when it is emptied.

Each kind of log gets its own time limit. Only a few people may read the logs.

The rules go into a list kept for data protection. We help you make the change.

An order does not arrive in the ERP, and the error message says little. So someone switches the interface logging to its most verbose level, and from then on every message lands in the log in full: name, delivery address, phone number, email address and, for direct debit, the IBAN. The bug is soon fixed, the setting stays. Meanwhile, messages that could not be delivered pile up in an error store, the dead-letter queue, and stay there until someone touches them. Next to the shop and the ERP, a third customer database emerges that nobody planned: without a retention period, without an access concept and without an entry in the record of processing activities. This article shows what an interface log really needs for debugging, how to drop, mask or pseudonymize fields, why the success log, the error log and the dead-letter queue get separate retention periods, and what a purge run for the dead-letter queue looks like. The legal framework is set by the GDPR principles of data minimization and storage limitation.

Key takeaways

  • Integration logs with full payloads are a customer database of their own. Data minimization and storage limitation apply (Art. 5(1)(c) and (e) GDPR); breaches fall under fines of up to EUR 20 million or 4 % of annual turnover, whichever is higher (Art. 83(5) GDPR).
  • For debugging, order number, correlation ID, timestamp, status, error code and the name of the affected field are usually enough. Name, address, phone and IBAN are dropped, masked or pseudonymized with a secret key.
  • Pseudonymized data remains personal data (Art. 4(5) GDPR). A plain hash of a name can be recomputed from a list of names (EDPB); a stable token needs a key kept outside the logging system.
  • Success log, error log and dead-letter queue get separate retention periods tied to events such as a confirmed reconciliation or a closed case. The Standard Data Protection Model as a rule weighs at least two deletion periods against each other (SDM module 43).
  • Logs with customer data are part of an access request that must as a rule be answered within one month (Art. 12(3) GDPR), and if such a log leaks, notification is due within 72 hours where feasible (Art. 33(1) GDPR).
  • Retention periods and logging measures belong in the record of processing activities (Art. 30(1)(f) GDPR). The exemption for fewer than 250 employees usually does not apply to an order interface that runs daily (Art. 30(5) GDPR).

How customer data ends up in the integration log

In a shop integration, orders, customer accounts, returns and payment notifications travel between systems as messages. Every station can log: the shop when sending, the middleware when receiving, transforming and delivering, the ERP when importing. The most convenient option is to store the complete message. Then every error can be traced against the original, and nobody has to decide in advance which fields matter. That very convenience turns a technical log into a copy of the customer database that keeps growing next to the shop and the ERP.

The problem is rarely a single log. It is the copies made from it. A line from the application log moves into a central logging system, from there into the nightly backup, as an excerpt into a ticket and as a screenshot into the chat with the service provider. Each of these places has its own access rights and its own retention rules, often none at all. The "Logging" module of the Standard Data Protection Model describes exactly this pattern: much log data is kept for good functional reasons but, while everything works, is rarely or never checked and is stored for very long periods as a reserve (SDM module 43).

  • Middleware application log: receipt, transformation and delivery per message, with the full payload at the verbose level.
  • API access log: method, path and status. It becomes personal data as soon as email addresses, search terms or customer numbers appear in the URL.
  • Dead-letter queue: messages that could not be delivered after all retries, with full content and often without expiry.
  • Central logging system: collected lines from all systems, searchable and usually with its own generous retention.
  • Backups and exports: copies of logs in backups, CSV exports and reports.
  • Tickets and messages: excerpts sent to colleagues or service providers to resolve an error.

Cleaning up logging therefore starts with an inventory of these places. That includes the tools the service provider runs itself. Whatever sits in a hosted integration platform or an external logging service counts just as much as your own server. Event-driven architectures with several consumers per message, as described in the article on event-driven architecture and message queues, multiply the number of places where a message is logged.

A log containing names and addresses is a processing of personal data like any other. The same principles apply as for the customer account in the shop, and two of them hit integration logs directly. Personal data must be adequate, relevant and limited to what is necessary in relation to the purposes, which is data minimization (Art. 5(1)(c) GDPR). And it may be kept in a form that permits identification only as long as necessary for those purposes, which is storage limitation (Art. 5(1)(e) GDPR).

For an interface log, this means the purpose is debugging and proof that a message was delivered. Whatever does not serve that purpose does not belong in it, and whatever has served it is deleted. The GDPR also requires that, by default, only data necessary for each specific purpose is processed, and it explicitly names the amount of data collected, the extent of processing, the period of storage and accessibility (Art. 25(2) GDPR). Logging that writes the full payload by default misses this standard in its basic configuration.

Accountability comes on top: the controller must be able to demonstrate compliance with the principles (Art. 5(2) GDPR). Breaches of the Art. 5 principles fall under the upper fine bracket of up to EUR 20 million (Art. 83(5) GDPR) or, for an undertaking, up to 4 percent (Art. 83(5) GDPR) of total worldwide annual turnover of the preceding financial year, whichever is higher. That is the ceiling, not a forecast for an individual case. In day-to-day work, what counts more is that your logging can be explained and evidenced in a few sentences when a complaint or audit comes in.

Information security reaches the same result from the other side. The BSI IT-Grundschutz requires logging to comply with data protection rules and requires log data to be deleted according to a defined process (BSI IT-Grundschutz OPS.1.1.5). The same module explicitly lists misconfigured logging as a threat, where personal data is logged and stored without authorization.

No blanket period in the law

The GDPR does not set a fixed storage period for integration logs. You derive the period from the purpose: how long is a log entry actually needed for debugging, reconciliation or proof? A number from another company or another system rarely fits your own integration. Record the triggering event and the reasoning instead.

What debugging really needs

Whoever investigates a failed transfer usually asks the same questions: Which message was it? When did it arrive, where was it going, what did the target system answer, and which field was affected? None of these questions needs the customer's name. The order number links the log entry to the record in the shop and in the ERP. Whoever needs to see the content looks it up there, with the rights they already have there.

The Standard Data Protection Model puts the same idea as a rule. If a clear link between an activity and its log entry can be established, for example through a precise timestamp, there is usually no reason to store content data in the log; as a rule, personal and content data should not be stored in the log data at all (SDM module 43). The OWASP logging guide lists bank account data, access tokens, passwords and sensitive personal data among the content that should not go into the log directly but be removed, masked, sanitized, hashed or encrypted, and it also names personal names, phone numbers and email addresses as data that may need special treatment (OWASP Logging Cheat Sheet).

FieldFor debuggingIn the log
Order number, message typeneeded, links log and documentin plain text
Correlation ID, timestampneeded, traces the path across all stationsin plain text
Status, error code, field nameneeded, describes the errorin plain text, without field content
Customer numberhelpful to spot clusterspseudonym with a secret key
Name, address, phone, emailusually not neededdrop
IBAN, card data, access tokensnot neededdrop, at most the last characters
Free text such as order notesnot needed, often contains sensitive detailsdrop
Full payloadonly case by case for resolutiononly in the dead-letter queue, encrypted and time-limited

The table is a starting point, not a rule book. For each interface, it is worth asking which fields were actually needed in recent error cases. In our experience the list is short, and the exceptions concern format errors in one specific field, such as a postal code the ERP rejects. Then the field name with the validation result is enough, for example "postal code missing" or "invalid format", not the value itself. How fields are mapped between systems is covered in the article on data mapping between ERP and shop; that is also where the list of fields a message carries is created.

Drop, mask, pseudonymize

For every field that should not go into the log in plain text, there are several options. They differ in whether the value can still be attributed later and who can do it. The GDPR explicitly names pseudonymization and encryption as examples of measures for the security of processing (Art. 32(1)(a) GDPR).

Drop

The field is removed before writing. The most effective option because nothing remains, and the right one for everything debugging does not need.

Allowlist

Instead of listing forbidden fields, a list defines which fields may enter the log. New fields in the message format stay out until someone approves them.

Mask

Part of the value is replaced, such as the IBAN except for the last characters. Useful for follow-up questions, but no protection for short values like postal codes.

Keyed pseudonym

A keyed method turns the customer number into a stable token. Clusters remain visible, attribution requires the separately stored key.

Reference, not copy

The log stores the order number and a queue ID. Only those authorized in the shop, the ERP or the dead-letter queue can read the content.

Encrypted payload

Where the whole message is needed, it sits encrypted in the dead-letter queue. Only a small role can read it, and every access is logged.

Pseudonymization deserves a closer look at the term. The GDPR defines it as processing after which the data can no longer be attributed to a specific person without the use of additional information, provided that information is kept separately and protected (Art. 4(5) GDPR). Pseudonymized data therefore remains personal data. The European Data Protection Board makes this clear in its guidelines on pseudonymization and gives an example that fits logs directly: if it is known that the transformation is merely a SHA-256 hash of a name, anyone with a list of names can compute the same hashes and find matches (EDPB Guidelines 01/2025).

For integration logs this leads to a simple rule. If you need a stable token, for instance to spot recurring errors for the same customer account, use a method with a secret key, such as an HMAC, and keep the key outside the logging system. The EDPB describes exactly this approach for security logs: identifiers such as IP addresses, access tokens and login credentials are transformed by a keyed cryptographic one-way function, provided they contain sufficient entropy, and removed otherwise (EDPB Guidelines 01/2025). Values with little entropy, such as postal codes or dates of birth, are therefore better dropped entirely.

error.log
// before: full payload in the error log
{"ts":"2026-11-06T09:14:02Z","level":"ERROR","event":"order.export",
 "order":"SO-104582","name":"Erika Mustermann","street":"Musterstraße 1",
 "phone":"030 23125 456","iban":"DE00123456789012345678",
 "status":422,"error":"zip invalid"}

// after: only what debugging needs
{"ts":"2026-11-06T09:14:02Z","level":"ERROR","event":"order.export",
 "order":"SO-104582","trace":"7f3a-c2e1-04b9","customer":"k_9b41e2",
 "status":422,"error":"zip invalid","field":"shipping.zip","dlq":"dlq-5521"}

The second line answers the same questions as the first: which order, when, which error, which field. Whoever needs the address for resolution opens the order in the shop or the entry in the dead-letter queue. Technically, it makes sense to implement this in one place, the logging module of the middleware, instead of in every connector separately. An allowlist per message type, a shared filter for known field names and an automated test that sends an order full of sample data and checks that none of the values appear in the log keep the rule stable through later format changes. The sample data belongs in a separate environment, as described in the article on test environments for ERP interfaces.

The dead-letter queue needs its own retention

The dead-letter queue is the safety net of every robust integration. A message that could not be delivered after all retries is not lost but lands in a separate store with the error reason and full content, as described in the article on error handling in interfaces. For debugging this is right: whoever wants to replay the message after a fix needs it in full.

From a data protection point of view, the dead-letter queue is the most sensitive part of logging. It contains exactly the messages where something went wrong, and therefore often the unusual ones: orders with special characters in the name, a different delivery address or free text the ERP could not process. Without a rule of its own, such a store keeps messages until someone processes or deletes them. If the case is left lying, the message stays too, for months or years. The dead-letter queue therefore needs its own life cycle with a clear end.

Life cycle of a message in the dead-letter queue

  1. 1

    Park

    After the last retry, the message goes into the dead-letter queue with error reason, time and order number. The payload is encrypted, the error log only receives a reference.

  2. 2

    Alert

    An alert goes to the responsible team with order number and error code, without customer data in subject or body.

  3. 3

    Resolve

    An authorized person opens the message, corrects master data or mapping and decides: resend, enter manually in the ERP or discard.

  4. 4

    Close

    The decision is recorded on the entry with time and handler. The defined follow-up period starts from this event.

  5. 5

    Purge

    A scheduled purge run removes the payload once the follow-up period has passed and keeps only the metadata: order number, error code, decision, date.

Make stalled cases visible

Besides the period after closure, the dead-letter queue needs an upper limit for unresolved cases. When an entry reaches it, it does not silently go into the purge run but escalates to the business team: either the case is decided now, or the reason for longer retention is documented. The age of the oldest entry belongs as a metric in the observability of your interfaces.

The purge run itself is a small program with a big effect. It logs how many entries it removed and raises an alert if it fails; otherwise the store keeps growing unnoticed. A receipt with count, period and checksum is enough as proof; the names of the people concerned do not belong in the purge log. The Standard Data Protection Model proposes an acknowledgment mechanism for this that replaces the log entry that would otherwise contain the names of the deleted personal data (SDM module 43). When a message is replayed after a fix, an idempotency key prevents the order from landing in the ERP twice; more on this in the article on idempotency and retry strategies.

Separate retention for success, errors and the queue

A single retention date for all logs is convenient and rarely fits. A success log is needed until the reconciliation between shop and ERP has confirmed that the message arrived. An error log is needed until the case is resolved, plus a follow-up period for queries. The dead-letter queue needs the payload only until the decision. The Standard Data Protection Model requires retention and deletion to be defined for log data and, as a rule, weighs at least two deletion periods (SDM module 43) against each other: the one derived from the business purpose and the one arising for functional reasons at the respective logging level. The business-based period is decisive.

StorePurposeContentEnd of retention
Success logprove delivery, measure throughputmetadata: order number, time, statusreconciliation confirmed, then follow-up period for queries
Error logfind errors, spot clustersmetadata plus error code and field namecase closed, then follow-up period for queries
Dead-letter queuecorrect and resend the messagefull payload, encrypteddecision made, then purge run
Verbose level (debug)narrow down one specific errorextended fields, enabled for a limited timeticket closed, level resets automatically
Deletion receiptprove deletioncount, period, checksumas defined in the deletion concept

The table deliberately gives no day counts. How long a follow-up period makes sense depends on how quickly queries from customer service and accounting typically arrive and how often reconciliation runs. Set the value per store, justify it in one sentence and let the system calculate the end from the event. How such a deletion concept is built across shop, ERP and accounting is described in the article on the deletion concept across system boundaries.

The verbose level deserves a rule of its own because it is the most common way full payloads slip into daily operations. Enable it only for a limited time and only for one interface, with automatic reset and a record of who activated it and when. The CWE weakness list maintained by MITRE lists writing sensitive information to log files as a weakness of its own and recommends, among other things, adjusting configurations when software moves from a debug state to production and protecting log files against unauthorized reading (MITRE CWE-532).

An objection often comes from accounting: the handover to the ERP must remain verifiable. That is true, but the proof does not need customer data. Whether a handover log counts among the other documents relevant for taxation under German tax law (Section 147(1) AO) is something to clarify with your tax advisor. Even then, document number, time, status and checksum are usually sufficient; the customer data sits in the document itself, which is kept in the ERP anyway. The GoBD process documentation then describes how this proof is produced.

Who may read logs: access and copies

Less content is the first lever, fewer readers the second. Logs are interesting to many roles: development, operations, customer service, external providers. Not all of them need the same view. OWASP recommends recording and monitoring all access to logs and restricting and periodically reviewing read privileges (OWASP Logging Cheat Sheet). The IT-Grundschutz additionally requires technical measures that prevent log data from being deleted or altered in an uncontrolled way (BSI IT-Grundschutz OPS.1.1.5). Together, this yields a log that is read only on purpose and deleted only as planned.

  • Separate roles: Operations sees metadata and metrics, only a small group with a business mandate opens the dead-letter queue.
  • Access logged: Whoever opened an entry in the dead-letter queue is recorded in the audit log with time and reason.
  • Providers included: The same rules apply to external maintenance, laid down in the data processing agreement.
  • Copies limited: Tickets and chats contain order number and error code, not copied log lines with customer data.
  • Backups accounted for: Retention of log backups follows the periods of the source or is justified separately.
  • Keys separated: The keys for pseudonyms and for the encrypted payload are not stored in the logging system.

Backups are the place most easily overlooked. A purge run that empties the dead-letter queue changes nothing about last week's backup. Record in the deletion concept how long backups of the logging systems are kept and align that duration with the periods of the logs they contain. If you are hardening your interfaces against attacks anyway, the matching measures are in the article on NIS2 and API security; a log without customer data shrinks the attack surface there as well.

Access requests, erasure, data breaches: logs count too

When a customer wants to know which data is stored about her, the integration logs are part of the answer if they contain her data. The information includes, among other things, the envisaged storage period or, if that is not possible, the criteria used to determine it (Art. 15(1)(d) GDPR). It must be provided without undue delay and in any event within one month (Art. 12(3) GDPR) of receipt of the request; an extension is only intended in justified cases. The Standard Data Protection Model requires the logging concept to state whether and how access requests can actually be answered from the log data (SDM module 43). If you have customer data in your logs, you must be able to search them by person, not just by order number.

Erasure works the same way. If a person requests erasure of their data and one of the statutory grounds applies, the data must be erased without undue delay (Art. 17(1) GDPR). A deletion path that reaches the shop, the ERP and the CRM but skips the dead-letter queue and the central logging system is incomplete. With plain references to the order number, this effort shrinks, because the content is handled at the source and the logs only hold identifiers with short retention.

That leaves data breaches. A logging system bundles data from many applications and can itself be a target of attacks. OWASP points out that logs contain users' personal data and that attackers gather it to release it or use it as a stepping stone for further attacks (OWASP Logging Cheat Sheet). If a log with customer data leaks, that is a personal data breach which the controller notifies to the supervisory authority without undue delay and, where feasible, within 72 hours (Art. 33(1) GDPR), unless it is unlikely to result in a risk to the people concerned. A log with order numbers and error codes makes this assessment much easier than one with addresses and bank details.

The entry in the record of processing activities

Interface logging is part of order processing or a separate activity in the record of processing activities. Where possible, it lists the envisaged time limits for erasure of the different categories of data (Art. 30(1)(f) GDPR) and a general description of the technical and organizational measures (Art. 30(1)(g) GDPR). The exemption for organizations employing fewer than 250 employees (Art. 30(5) GDPR) only applies if, among other conditions, the processing is merely occasional. An order interface that runs every day usually does not meet that condition.

  • Purpose: debugging, proof of delivery and reconciliation of the interface.
  • Data categories per store: metadata in success and error logs, full order data only in the dead-letter queue.
  • Recipients: internal roles, maintenance providers, an external logging service with its location where applicable.
  • Deletion periods: per store the triggering event and the follow-up period, plus the backups.
  • Measures: allowlist, masking, pseudonym with a separate key, encryption, access log.

The entry is not an end in itself. It forces you to answer in writing, once, the questions that otherwise come up under time pressure with the first access request or audit. Document the technical side in the same place as the interface, for example in the OpenAPI description, with a note on which fields are personal data and are therefore not logged. That way even a new service provider sees at a glance which fields have no place in the log.

Retrofitting existing interfaces in five steps

List every place where messages or excerpts end up: application logs, central logging system, dead-letter queue, backups, tickets. Record who has access to each.

The last step is easily forgotten. A new filter only protects the lines written from today onward. Whatever accumulated with full payloads in past months stays put until someone actively removes it. Schedule a separate date for this, and afterwards search for typical patterns such as IBAN formats or email addresses to check whether the data has really been cleaned up. If you are planning changes to the order handover anyway, for instance for order changes after the ERP export, switch the logging over at the same time. For your own connectors and interfaces we support you as part of API development, and when connecting your ERP and inventory system the logging rule belongs in the plan from the start.

The order number is enough

An integration log has to answer which message went where and when, and why it failed. Order number, time, status and error code are enough for that. Everything else is in the shop and the ERP, with the rights and retention periods that apply there anyway. The dead-letter queue holds the rest, encrypted and only until the decision.
This article is based on data from: General Data Protection Regulation (Regulation (EU) 2016/679), Art. 4(5), Art. 5(1) and (2), Art. 12(3), Art. 15(1), Art. 17(1), Art. 25(2), Art. 30(1) and (5), Art. 32(1), Art. 33(1) and Art. 83(5), quoted from the German text edition of the Berlin Commissioner for Data Protection and Freedom of Information (revised edition, December 2025); European Data Protection Board (EDPB), Guidelines 01/2025 on Pseudonymisation, version for public consultation of January 2025; Standard Data Protection Model, module 43 "Protokollieren" (logging), version 2.0; BSI IT-Grundschutz Compendium, module OPS.1.1.5 Logging; OWASP Logging Cheat Sheet; MITRE CWE-532 "Insertion of Sensitive Information into Log File"; German Fiscal Code (Abgabenordnung), Section 147(1). The notes on data protection and tax law do not replace legal advice.

Related Articles

Law & compliance

Deletion Concept Across Shop, ERP and Accounting Systems

Retention periods, deletion classes and one deletion path reaching shop, ERP and accounting at once: what applies, what is deleted and what gets restricted.

19 min read
ERP & merchandise management

Multi-Entity ERP: Running One Shop Across Company Codes

Corporate groups running several ERP entities and one shop: item routing, number ranges, tax codes, stock aggregation and order splitting done properly.

13 min read
APIs, middleware & architecture

ERP Outage: Keeping the Shop Selling in Fallback Mode

Absorb an ERP outage: last valid stock and prices with an age stamp, buffered orders, conservative checkout rules and an orderly, deduplicated restart.

13 min read