Brazil has a fair new "Internet law" [1] that states, among other things that:
1) Internet providers must not log any information about users traffic, except information related to the network access itself (like the IPv4 dynamic address attributed to the user's modem)
2) Application providers must log all actions performed by its users and retain for at least 6 months.
3) Any judge can request to an application owner the complete access log of anybody.
4) If the company does not comply to the request it can be fined up to 10% of its local revenue; face temporary or permanent shutdown.
WhatsApp ignored the law for two times and a 1st instance judge ordered the temporary ban to be performed by the major network providers. In both cases the order was latter revoked by 2nd instance judges.
Keep in mind that our "Internet law" was praised by everybody, including the international community, for its explicit creation of rules for internet neutrality. Turns out that the price for internet neutrality was mandatory massive surveillance
[1]: PT-BR source: http://www.planalto.gov.br/ccivil_03/_ato2011-2014/2014/lei/...