The rules sit in the Federal Act on the Surveillance of Post and Telecommunications (BÜPF in German, LSCPT in French, SR 780.1) and its implementing ordinance, the VÜPF/OSCPT (SR 780.11). The Act sorts providers into categories, and the category decides the duties. Telecommunications service providers, such as access providers and mobile operators, carry other people's traffic, and Art. 26(5) BÜPF requires them to keep the secondary data of that traffic for six months: who communicated with whom, when, and over which connection. That provision is what people mean by Swiss data retention.
Providers of derived communication services form the second group. These are services built on top of a telecommunications network rather than the network itself, and Art. 27 BÜPF frames them by the data a person "transmits or stores" through them, which is where webmail, cloud storage and hosting land. Their obligations are passive. They must tolerate surveillance run by the Post and Telecommunications Surveillance Service (PTSS, Dienst ÜPF), give it access to their facilities, and supply on request the secondary data "available to them". The Act sets no retention period for this group. A log that was never kept cannot be produced, and nothing in the Act requires a standard derived-service provider to start one.