Law 51 was published in Gaceta Oficial 26374 on 23 September 2009, under a title that announces its scope: rules for the conservation, protection and supply of data belonging to users of telecommunications services. The obligation sits in article 6. It names telecommunications companies and internet cafés explicitly, extends to other communication networks that provide or sell the service, and fixes the period at six months counted from the day the data is generated.
Two questions decide whether that reaches a server in PTY1. The first is classification. A carrier and a cybercafé both connect a person to the network, and the list reads as if it was drafted with that kind of access provider in mind. We sell compute, storage and transit to customers who then run their own services, and whether that makes us a "communication network" within article 6 is precisely the point we cannot resolve by reading the text harder. The second is whose data is meant. On any reading, the user of our service is our customer, not the people visiting our customer's website. The access logs nginx writes on your VPS sit on your disk under your rotation settings; they are your records and your exposure.
Law 81 of 26 March 2019 on personal data protection, implemented by Executive Decree 285 of 28 May 2021, is the other statute people cite here, usually for the wrong reason. It is a protection law. It governs how personal data is processed and gives no order to accumulate traffic records.
Access is a separate layer, set by Article 29 of the Constitution: private communications may be intercepted or recorded only on the order of a judicial authority, and private documents examined only on the order of a competent authority and for specific purposes. Retention decides what exists to be handed over; article 29 decides who may demand it. Our page on surveillance and lawful access in Panama covers that second half in detail.