Mailboxd logs and editing crontab

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Paladinemishakal
Posts: 48
Joined: Sat Sep 13, 2014 2:37 am

Mailboxd logs and editing crontab

Postby Paladinemishakal » Thu Mar 21, 2013 6:24 am

Hi All,
I have 3 Zimbra 7.2.0_GA_2669 servers running as mail store and I have this problem where the log directory under /opt/zimbra is growing too big. I am looking at ways to reduce the number of days of logs to keep.
I am looking at reducing this type of log: access_log.YYYY-MM-DD which the system is keeping 32 days worth of data.
Checking in the crontab for zimbra user, I notice this particular line that is removing any log files that is older than 8 days:

# crontab.store

#

# Log pruning

#

30 2 * * * find /opt/zimbra/mailboxd/logs/ -type f -name *log* -mtime +8 -exec rm {} ; > /dev/null 2>&1
I checked in /opt/zimbra/mailboxd/logs directory, there is nothing in the directory. I also tried checking the /opt/zimbra/conf/log4j.properties and log4j.properties.in, the content did not contain any variables for me to configure the /opt/zimbra/mailboxd/logs.
Questions:

1. Where do I go to configure the logging properties for "access_log.YYYY-MM-DD" and made persistent changes?

2. Is it possible for me to compress "access_log.YYYY-MM-DD" and cron it to delete the compressed logs?

3. When listing the zimbra user's crontab, the file mention not to edit anything between the ZIMBRASTART and ZIMBRAEND, so how do make changes to the crontab?

4. Does the changes I made, will be survive through Zimbra upgrades?
Thanks & Regards.


Paladinemishakal
Posts: 48
Joined: Sat Sep 13, 2014 2:37 am

Mailboxd logs and editing crontab

Postby Paladinemishakal » Fri Mar 22, 2013 12:09 am

Hi All,
I did a check with "zmprov gcf zimbraLogRawLifetime" and the system reply that it is set to 31d. Checking on my system, the only set of logfiles that about 31 days worth of data is the access_log.YYYY-MM-DD.
I proceed to set it to 7d as follows:

# zmprov mcf zimbraLogRawLifetime 7d

# /opt/zimbra/libexec/zmlogprocess

# /opt/zimbra/libexec/zmstatuslog
Checking back in the /opt/zimbra/log, I still see the 31 days of access_log. Will it be clear by the cron the next it run? Anyone can help?
Regards.
[quote user="Paladinemishakal"]Hi All,
I have 3 Zimbra 7.2.0_GA_2669 servers running as mail store and I have this problem where the log directory under /opt/zimbra is growing too big. I am looking at ways to reduce the number of days of logs to keep.
I am looking at reducing this type of log: access_log.YYYY-MM-DD which the system is keeping 32 days worth of data.
Checking in the crontab for zimbra user, I notice this particular line that is removing any log files that is older than 8 days:

# crontab.store

#

# Log pruning

#

30 2 * * * find /opt/zimbra/mailboxd/logs/ -type f -name *log* -mtime +8 -exec rm {} ; > /dev/null 2>&1
I checked in /opt/zimbra/mailboxd/logs directory, there is nothing in the directory. I also tried checking the /opt/zimbra/conf/log4j.properties and log4j.properties.in, the content did not contain any variables for me to configure the /opt/zimbra/mailboxd/logs.
Questions:

1. Where do I go to configure the logging properties for "access_log.YYYY-MM-DD" and made persistent changes?

2. Is it possible for me to compress "access_log.YYYY-MM-DD" and cron it to delete the compressed logs?

3. When listing the zimbra user's crontab, the file mention not to edit anything between the ZIMBRASTART and ZIMBRAEND, so how do make changes to the crontab?

4. Does the changes I made, will be survive through Zimbra upgrades?
Thanks & Regards.[/QUOTE]
Paladinemishakal
Posts: 48
Joined: Sat Sep 13, 2014 2:37 am

Mailboxd logs and editing crontab

Postby Paladinemishakal » Tue Mar 26, 2013 4:01 am

Hi All,
I have finally found out where the configuration for this access_log.YYYY-MM-DD is.
Here is the steps I have taken to find the process that is writing to the /opt/zimbra/log/access_log.2013-03-26:

# fuser -a /opt/zimbra/log/access_log.2013-03-26

/opt/zimbra/log/access_log.2013-03-26: 8096
Checking in ps:

# ps aux | grep 8096

zimbra 8096 0.3 13.7 959588 282132 ? Sl Mar23 12:05 /opt/zimbra/java/bin/java -Dfile.encoding=UTF-8 -server -Djava.awt.headless=true -Dsun.net.inetaddr.ttl=60 -XX:+UseConcMarkSweepGC -XX:PermSize=128m -XX:MaxPermSize=128m -XX:SoftRefLRUPolicyMSPerMB=1 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -XX:-OmitStackTraceInFastThrow -Xss256k -Xms512m -Xmx512m -Xmn128m -Djava.io.tmpdir=/opt/zimbra/mailboxd/work -Djava.library.path=/opt/zimbra/lib -Djava.endorsed.dirs=/opt/zimbra/mailboxd/common/endorsed -Dzimbra.config=/opt/zimbra/conf/localconfig.xml -Djetty.home=/opt/zimbra/mailboxd -DSTART=/opt/zimbra/mailboxd/etc/start.config -jar /opt/zimbra/mailboxd/start.jar /opt/zimbra/mailboxd/etc/jetty.properties /opt/zimbra/mailboxd/etc/jetty-setuid.xml /opt/zimbra/mailboxd/etc/jetty.xml
Looking in each of the stated file, I found that the setting is in /opt/zimbra/mailboxd/etc/jetty.xml and /opt/zimbra/mailboxd/etc/jetty.xml.in























/../log/access_log.yyyy_mm_dd

dd/MMM/yyyy:HH:mm:ss Z

30

true

true

yyyy-MM-dd

true








Questions:

1. Which files "jetty.xml" or "jetty.xml.in" do I edit?

2. How do I effect the changes?

3. What services do I need to restart? Is it "zmcontrol mailbox restart" or "zmmailboxdctl restart"?
Hope someone can help me on this.
Thanks & Regards,


[quote user="Paladinemishakal"]Hi All,
I have 3 Zimbra 7.2.0_GA_2669 servers running as mail store and I have this problem where the log directory under /opt/zimbra is growing too big. I am looking at ways to reduce the number of days of logs to keep.
I am looking at reducing this type of log: access_log.YYYY-MM-DD which the system is keeping 32 days worth of data.
Checking in the crontab for zimbra user, I notice this particular line that is removing any log files that is older than 8 days:

# crontab.store

#

# Log pruning

#

30 2 * * * find /opt/zimbra/mailboxd/logs/ -type f -name *log* -mtime +8 -exec rm {} ; > /dev/null 2>&1
I checked in /opt/zimbra/mailboxd/logs directory, there is nothing in the directory. I also tried checking the /opt/zimbra/conf/log4j.properties and log4j.properties.in, the content did not contain any variables for me to configure the /opt/zimbra/mailboxd/logs.
Questions:

1. Where do I go to configure the logging properties for "access_log.YYYY-MM-DD" and made persistent changes?

2. Is it possible for me to compress "access_log.YYYY-MM-DD" and cron it to delete the compressed logs?

3. When listing the zimbra user's crontab, the file mention not to edit anything between the ZIMBRASTART and ZIMBRAEND, so how do make changes to the crontab?

4. Does the changes I made, will be survive through Zimbra upgrades?
Thanks & Regards.[/QUOTE]
speno
Advanced member
Advanced member
Posts: 56
Joined: Sat Sep 13, 2014 1:08 am

Mailboxd logs and editing crontab

Postby speno » Tue Mar 26, 2013 4:44 pm

Edit jetty.xml.in and as the zimbra user, zmmailboxdctl restart should suffice. And no, it won't survive through Zimbra upgrades. Welcome to the world of Zimbra.
Paladinemishakal
Posts: 48
Joined: Sat Sep 13, 2014 2:37 am

Mailboxd logs and editing crontab

Postby Paladinemishakal » Tue Mar 26, 2013 8:43 pm

Hi Speno,
Thanks for replying. This change is only localized to the mailstore that has the changes, correct?
After I restart with zmmailboxdctl, I checked in /opt/zimbra/log, the 31days of access_log is still there, will the system remove the logs the next day?
Regards.
[quote user="speno"]Edit jetty.xml.in and as the zimbra user, zmmailboxdctl restart should suffice. And no, it won't survive through Zimbra upgrades. Welcome to the world of Zimbra.[/QUOTE]
Paladinemishakal
Posts: 48
Joined: Sat Sep 13, 2014 2:37 am

Mailboxd logs and editing crontab

Postby Paladinemishakal » Wed Mar 27, 2013 8:45 pm

Hi All,
I have checked on my server and the number of access_log is now reduced to 7 days + 2 (yesterday's log + today's log).
Thanks everyone.


[quote user="Paladinemishakal"]Hi Speno,
Thanks for replying. This change is only localized to the mailstore that has the changes, correct?
After I restart with zmmailboxdctl, I checked in /opt/zimbra/log, the 31days of access_log is still there, will the system remove the logs the next day?
Regards.[/QUOTE]
speno
Advanced member
Advanced member
Posts: 56
Joined: Sat Sep 13, 2014 1:08 am

Mailboxd logs and editing crontab

Postby speno » Wed Mar 27, 2013 8:58 pm

[quote user="Paladinemishakal"]Hi Speno,
Thanks for replying. This change is only localized to the mailstore that has the changes, correct?

[/QUOTE]
Yes, only on the mailstore where you made the change.

Return to “Administrators”

Who is online

Users browsing this forum: No registered users and 13 guests