Hello!
How can I make Joomla replace the last 2 digits of the IP addresses logged in the Joomla log files with *?
i. e. error.php, joomla_update.php
Kind regards,
Gerald
Anonymize client IP addresses in Joomla log files - how?
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
-
- Joomla! Enthusiast
- Posts: 117
- Joined: Tue Jun 03, 2014 3:37 pm
-
- Joomla! Enthusiast
- Posts: 117
- Joined: Tue Jun 03, 2014 3:37 pm
Re: Anonymize client IP addresses in Joomla log files - how?
Hi again!
@Development team:
As this is a serious matter concerning GDPR I'd be grateful for your feedback to my inquiry.
Thank you very much in advance!
Kind regards,
Gerald
@Development team:
As this is a serious matter concerning GDPR I'd be grateful for your feedback to my inquiry.
Thank you very much in advance!
Kind regards,
Gerald
- pe7er
- Joomla! Master
- Posts: 24985
- Joined: Thu Aug 18, 2005 8:55 pm
- Location: Nijmegen, Netherlands
- Contact:
Re: Anonymize client IP addresses in Joomla log files - how?
Thank you for your concern! Privacy is IMHO a very important subject and complying with the GDPR too.
However I don't think that this is a GDPR or privacy issue.
IMHO you don't need a technical solution. Just document it in your Processing Index and in your website's privacy statement.
The Processing Index is documentation for the Privacy Authorities about your processing activities: details of the controller ( = responsible person), data categories, the purpose of the data processing, legal justification, categories of recipients (with who do you share the data), deleting deadline, security measures to safeguard that data).
Legitimate interest of the controller
- To me collecting IP addresses that cause errors (by default logged in administrator/logs/error.php) on your website seems like a legitimate interest of the controller: As website owner you need to be able to find the cause of errors and solve them.
- The update logs (by default logged in administrator/logs/joomla_update.php) don't record visitor's IP addresses but only the name + IP address of the super administrator who did the update.
If you don't agree with me, no worries :-)
You can always create an issue about it at: https://github.com/joomla/joomla-cms/issues
If other people agree with you, then maybe we can make the collection of IP address with errors / updates optional.
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com
-
- Joomla! Enthusiast
- Posts: 117
- Joined: Tue Jun 03, 2014 3:37 pm
Re: Anonymize client IP addresses in Joomla log files - how?
Hi!
Thank you very much for taking time for my question!
I do understand your explanation and your point of view.
Actually I indeed have to enable IP address masking in the access_log / error_log on the web servers of some customers.
Due to different requirements by customers, in my opinion Joomla should leave it up to the website admin to choose whether the IP addresses in Joomla's log files are masked or not - ideally for each log file separately.
Who does agree with me in that issue?
Kind regards,
Gerald
BTW: I created an issue on Github https://github.com/joomla/joomla-cms/issues/34735.
Thank you very much for taking time for my question!
I do understand your explanation and your point of view.
Actually I indeed have to enable IP address masking in the access_log / error_log on the web servers of some customers.
Due to different requirements by customers, in my opinion Joomla should leave it up to the website admin to choose whether the IP addresses in Joomla's log files are masked or not - ideally for each log file separately.
Who does agree with me in that issue?
Kind regards,
Gerald
BTW: I created an issue on Github https://github.com/joomla/joomla-cms/issues/34735.
- pe7er
- Joomla! Master
- Posts: 24985
- Joined: Thu Aug 18, 2005 8:55 pm
- Location: Nijmegen, Netherlands
- Contact:
Re: Anonymize client IP addresses in Joomla log files - how?
Great!gba wrote: ↑Thu Jul 08, 2021 9:22 amBTW: I created an issue on Github https://github.com/joomla/joomla-cms/issues/34735.
If someone creates some code to make it configurable, and it will be added to the Joomla core, then it will only be for Joomla 4.x. There won't be new features added to Joomla 3.
Another option to change Joomla's behavior is with plugins.
I guess that it's possible to write a plugin that removes that information before it is stored.
Or removes it afterwards from the database table.
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com
-
- Joomla! Enthusiast
- Posts: 117
- Joined: Tue Jun 03, 2014 3:37 pm
Re: Anonymize client IP addresses in Joomla log files - how?
Here is my code:
Code: Select all
JLog::addLogger(
array(
'text_file' => 'my.php',
'text_entry_format' => '{DATE}|{TIME}|{CLIENTIP}|{PRIORITY}|{MESSAGE}'
),
JLog::ALL,
array('myarray')
);
$entry = new Joomla\CMS\Log\LogEntry('mytext', JLog::ERROR, 'myarray');
$entry->clientIP = substr(Joomla\Utilities\IpHelper::getIp(),0,-2).'**';
JLog::add($entry);
-
- Joomla! Enthusiast
- Posts: 117
- Joined: Tue Jun 03, 2014 3:37 pm
Re: Anonymize client IP addresses in Joomla log files - how?
Is that of help for you?gba wrote: ↑Thu Jul 08, 2021 12:30 pmHere is my code:Code: Select all
JLog::addLogger( array( 'text_file' => 'my.php', 'text_entry_format' => '{DATE}|{TIME}|{CLIENTIP}|{PRIORITY}|{MESSAGE}' ), JLog::ALL, array('myarray') ); $entry = new Joomla\CMS\Log\LogEntry('mytext', JLog::ERROR, 'myarray'); $entry->clientIP = substr(Joomla\Utilities\IpHelper::getIp(),0,-2).'**'; JLog::add($entry);