Which log files are which ? Standard vs. custom, etc


#1

Hi,

When I look at /var/log/nginx/ I can see the default log files as well as a few that are related to my domain name:

access.log (default) error.log (default) mydomain.access.log mydomain.error.log

There also seem to be symbolic links in /var/www/domainname.com/logs/ :

access.log -> /var/log/nginx/domainname.com.access.log error.log -> /var/log/nginx/domainname.com.error.log

This has my a little confused. Which log file is the one created by NGINX and which is the final log file for the domain name ? What’s the difference here ? I need to know in order to configure fail2ban and logrotate correctly.

Thanks, Lex


#2

Have you read the commends page yet? https://easyengine.io/docs/commands/log/


#3

Yes I have … But it doesn’t explain the workings of the structure. …

Normally f/e : nginx will write to the access.log and error.log. I would like to know if these are still used or that everything has switched to : domainname.access.log / domainname.error.log …

In other words… which are the log files that will keep on growing with time ? Is the default log file still used ? That was the question… the commands speak for themselves ofcourse …


#4

You can check which logs nginx is using in /etc/nginx/sites-available/site-name Replace site-name with the name of your site.


#5

Hi Garikai…

Thanks … it seems that easyengine configures things so that the domain name is added to the log files. So I can safely take it that access.log / error.log (default) are not used anymore ? I ask this because I need to configure some paths that lead to the log files (fail2ban etc.)

lex


#6

The default behaviour is that each site has it’s own pair of log files at:

/var/log/nginx/example.com.access.log /var/log/nginx/example.com.error.log

My solution is to use the wp-fail2ban plugin which comes with it’s own filter-file which you can add into the fail2ban filter folder. Then you can create a [wordpress] for all your sites in one place without worrying too much about logs. I don’t know if this will suit your needs but I find this set up pretty flexible, I use a CDN and using custom actions for fail2ban I can block bots before they even reach my site.


#7

Thanks Garikal …

I am using one server with a click tracker on it, making it impossible to let that run through a CDN … hence the solutions to with F2B directly.

Many people who run a tracker see to switch of their logs, because they heard that the server becomes quicker… however it leaves them open to more bots I believe … (just a tip I threw up here) …

I will have a look that plugin as well … I might use that on my WP blogs … Thanks again …

Lex


#8