[Wok] Rotate wok logs

Use logrotate to compress and keep 10 logs of 1MB Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- Makefile.am | 2 ++ contrib/Makefile.am | 1 + contrib/wok.spec.fedora.in | 1 + contrib/wok.spec.suse.in | 1 + contrib/wokd.logrotate | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 contrib/wokd.logrotate diff --git a/Makefile.am b/Makefile.am index 278bda1..6d4c574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,6 +140,8 @@ install-data-local: mkdir -p $(DESTDIR)/etc/wok/ $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem touch $(DESTDIR)/etc/nginx/conf.d/wok.conf + mkdir -p $(DESTDIR)/etc/logrotate.d/ + $(INSTALL_DATA) $(top_srcdir)/contrib/wokd.logrotate $(DESTDIR)/etc/logrotate.d/wokd uninstall-local: @if test -f $(systemdsystemunitdir)/wokd.service; then \ diff --git a/contrib/Makefile.am b/contrib/Makefile.am index ed4a006..2939bc9 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -29,6 +29,7 @@ EXTRA_DIST = \ wokd-upstart.conf.debian \ wokd-upstart.conf.fedora \ make-deb.sh.in \ + wokd.logrotate \ $(NULL) make-deb.sh: make-deb.sh.in $(top_builddir)/config.status diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in index 34b3ac3..feea7f1 100644 --- a/contrib/wok.spec.fedora.in +++ b/contrib/wok.spec.fedora.in @@ -116,6 +116,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/wok/wok.conf %{_sysconfdir}/wok/ +%{_sysconfdir}/logrotate.d/wokd %{_mandir}/man8/wokd.8.gz %if 0%{?with_systemd} diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in index aab4a80..fa477e1 100644 --- a/contrib/wok.spec.suse.in +++ b/contrib/wok.spec.suse.in @@ -93,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/wok/ %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/nginx/conf.d/wok.conf +%{_sysconfdir}/logrotate.d/wokd %{_var}/lib/wok/ %{_localstatedir}/log/wok/* %{_localstatedir}/log/wok/ diff --git a/contrib/wokd.logrotate b/contrib/wokd.logrotate new file mode 100644 index 0000000..2a03106 --- /dev/null +++ b/contrib/wokd.logrotate @@ -0,0 +1,30 @@ +# +# Project Wok +# +# Copyright IBM Corp, 2016 +# +# Code derived from Project Kimchi +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +/var/log/wok/*log { + daily + maxsize 1024k + rotate 10 + missingok + compress + sharedscripts +} + -- 2.1.0

On 01/14/2016 03:13 PM, Ramon Medeiros wrote:
Use logrotate to compress and keep 10 logs of 1MB
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- Makefile.am | 2 ++ contrib/Makefile.am | 1 + contrib/wok.spec.fedora.in | 1 + contrib/wok.spec.suse.in | 1 + contrib/wokd.logrotate | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 contrib/wokd.logrotate
diff --git a/Makefile.am b/Makefile.am index 278bda1..6d4c574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,6 +140,8 @@ install-data-local: mkdir -p $(DESTDIR)/etc/wok/ $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem touch $(DESTDIR)/etc/nginx/conf.d/wok.conf + mkdir -p $(DESTDIR)/etc/logrotate.d/
Is really necessary create the /etc/logrotate.d directory? I suppose you are adding a new configuration to the logrotate, right? So, if I already have logrotate installed in this box, this line is not necessary. In addition, I guess you should add the package logrotate as runtime dependency for all distros.
+ $(INSTALL_DATA) $(top_srcdir)/contrib/wokd.logrotate $(DESTDIR)/etc/logrotate.d/wokd
uninstall-local: @if test -f $(systemdsystemunitdir)/wokd.service; then \ diff --git a/contrib/Makefile.am b/contrib/Makefile.am index ed4a006..2939bc9 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -29,6 +29,7 @@ EXTRA_DIST = \ wokd-upstart.conf.debian \ wokd-upstart.conf.fedora \ make-deb.sh.in \ + wokd.logrotate \ $(NULL)
make-deb.sh: make-deb.sh.in $(top_builddir)/config.status diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in index 34b3ac3..feea7f1 100644 --- a/contrib/wok.spec.fedora.in +++ b/contrib/wok.spec.fedora.in @@ -116,6 +116,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/wok/wok.conf %{_sysconfdir}/wok/ +%{_sysconfdir}/logrotate.d/wokd %{_mandir}/man8/wokd.8.gz
%if 0%{?with_systemd} diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in index aab4a80..fa477e1 100644 --- a/contrib/wok.spec.suse.in +++ b/contrib/wok.spec.suse.in @@ -93,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/wok/ %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/nginx/conf.d/wok.conf +%{_sysconfdir}/logrotate.d/wokd %{_var}/lib/wok/ %{_localstatedir}/log/wok/* %{_localstatedir}/log/wok/ diff --git a/contrib/wokd.logrotate b/contrib/wokd.logrotate new file mode 100644 index 0000000..2a03106 --- /dev/null +++ b/contrib/wokd.logrotate @@ -0,0 +1,30 @@ +# +# Project Wok +# +# Copyright IBM Corp, 2016 +# +# Code derived from Project Kimchi
This code is not derived from Project Kimchi :-P
+# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +/var/log/wok/*log { + daily + maxsize 1024k + rotate 10 + missingok + compress + sharedscripts +} +

On 01/14/2016 03:38 PM, Paulo Ricardo Paz Vital wrote:
On 01/14/2016 03:13 PM, Ramon Medeiros wrote:
Use logrotate to compress and keep 10 logs of 1MB
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- Makefile.am | 2 ++ contrib/Makefile.am | 1 + contrib/wok.spec.fedora.in | 1 + contrib/wok.spec.suse.in | 1 + contrib/wokd.logrotate | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 contrib/wokd.logrotate
diff --git a/Makefile.am b/Makefile.am index 278bda1..6d4c574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,6 +140,8 @@ install-data-local: mkdir -p $(DESTDIR)/etc/wok/ $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem touch $(DESTDIR)/etc/nginx/conf.d/wok.conf + mkdir -p $(DESTDIR)/etc/logrotate.d/ Is really necessary create the /etc/logrotate.d directory? I suppose you are adding a new configuration to the logrotate, right? So, if I already have logrotate installed in this box, this line is not necessary.
We need to create this directory because rpmbuild need the complete structure of the file system to generate the package
In addition, I guess you should add the package logrotate as runtime dependency for all distros. OK
+ $(INSTALL_DATA) $(top_srcdir)/contrib/wokd.logrotate $(DESTDIR)/etc/logrotate.d/wokd
uninstall-local: @if test -f $(systemdsystemunitdir)/wokd.service; then \ diff --git a/contrib/Makefile.am b/contrib/Makefile.am index ed4a006..2939bc9 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -29,6 +29,7 @@ EXTRA_DIST = \ wokd-upstart.conf.debian \ wokd-upstart.conf.fedora \ make-deb.sh.in \ + wokd.logrotate \ $(NULL)
make-deb.sh: make-deb.sh.in $(top_builddir)/config.status diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in index 34b3ac3..feea7f1 100644 --- a/contrib/wok.spec.fedora.in +++ b/contrib/wok.spec.fedora.in @@ -116,6 +116,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/wok/wok.conf %{_sysconfdir}/wok/ +%{_sysconfdir}/logrotate.d/wokd %{_mandir}/man8/wokd.8.gz
%if 0%{?with_systemd} diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in index aab4a80..fa477e1 100644 --- a/contrib/wok.spec.suse.in +++ b/contrib/wok.spec.suse.in @@ -93,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/wok/ %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/nginx/conf.d/wok.conf +%{_sysconfdir}/logrotate.d/wokd %{_var}/lib/wok/ %{_localstatedir}/log/wok/* %{_localstatedir}/log/wok/ diff --git a/contrib/wokd.logrotate b/contrib/wokd.logrotate new file mode 100644 index 0000000..2a03106 --- /dev/null +++ b/contrib/wokd.logrotate @@ -0,0 +1,30 @@ +# +# Project Wok +# +# Copyright IBM Corp, 2016 +# +# Code derived from Project Kimchi This code is not derived from Project Kimchi :-P Like we say in brazilian portuguese: "HUE HUE HUE"
+# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +/var/log/wok/*log { + daily + maxsize 1024k + rotate 10 + missingok + compress + sharedscripts +} +
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
-- Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com

In addition to Paulo's comments, you also need to remove the logging rotate configuration from cherrypy (src/wok/server.py). I am not sure how those configuration (logrotate and cherrypy config) can live together without issues. On 01/14/2016 03:13 PM, Ramon Medeiros wrote:
Use logrotate to compress and keep 10 logs of 1MB
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- Makefile.am | 2 ++ contrib/Makefile.am | 1 + contrib/wok.spec.fedora.in | 1 + contrib/wok.spec.suse.in | 1 + contrib/wokd.logrotate | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 contrib/wokd.logrotate
diff --git a/Makefile.am b/Makefile.am index 278bda1..6d4c574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,6 +140,8 @@ install-data-local: mkdir -p $(DESTDIR)/etc/wok/ $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem touch $(DESTDIR)/etc/nginx/conf.d/wok.conf + mkdir -p $(DESTDIR)/etc/logrotate.d/ + $(INSTALL_DATA) $(top_srcdir)/contrib/wokd.logrotate $(DESTDIR)/etc/logrotate.d/wokd
uninstall-local: @if test -f $(systemdsystemunitdir)/wokd.service; then \ diff --git a/contrib/Makefile.am b/contrib/Makefile.am index ed4a006..2939bc9 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -29,6 +29,7 @@ EXTRA_DIST = \ wokd-upstart.conf.debian \ wokd-upstart.conf.fedora \ make-deb.sh.in \ + wokd.logrotate \ $(NULL)
make-deb.sh: make-deb.sh.in $(top_builddir)/config.status diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in index 34b3ac3..feea7f1 100644 --- a/contrib/wok.spec.fedora.in +++ b/contrib/wok.spec.fedora.in @@ -116,6 +116,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/wok/wok.conf %{_sysconfdir}/wok/ +%{_sysconfdir}/logrotate.d/wokd %{_mandir}/man8/wokd.8.gz
%if 0%{?with_systemd} diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in index aab4a80..fa477e1 100644 --- a/contrib/wok.spec.suse.in +++ b/contrib/wok.spec.suse.in @@ -93,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/wok/ %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/nginx/conf.d/wok.conf +%{_sysconfdir}/logrotate.d/wokd %{_var}/lib/wok/ %{_localstatedir}/log/wok/* %{_localstatedir}/log/wok/ diff --git a/contrib/wokd.logrotate b/contrib/wokd.logrotate new file mode 100644 index 0000000..2a03106 --- /dev/null +++ b/contrib/wokd.logrotate @@ -0,0 +1,30 @@ +# +# Project Wok +# +# Copyright IBM Corp, 2016 +# +# Code derived from Project Kimchi +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +/var/log/wok/*log { + daily + maxsize 1024k + rotate 10 + missingok + compress + sharedscripts +} +

Hi Aline, i just got a point about that in this thread: http://lists.ovirt.org/pipermail/kimchi-devel/2016-January/013438.html On 01/18/2016 10:19 AM, Aline Manera wrote:
In addition to Paulo's comments, you also need to remove the logging rotate configuration from cherrypy (src/wok/server.py). I am not sure how those configuration (logrotate and cherrypy config) can live together without issues.
On 01/14/2016 03:13 PM, Ramon Medeiros wrote:
Use logrotate to compress and keep 10 logs of 1MB
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- Makefile.am | 2 ++ contrib/Makefile.am | 1 + contrib/wok.spec.fedora.in | 1 + contrib/wok.spec.suse.in | 1 + contrib/wokd.logrotate | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 contrib/wokd.logrotate
diff --git a/Makefile.am b/Makefile.am index 278bda1..6d4c574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,6 +140,8 @@ install-data-local: mkdir -p $(DESTDIR)/etc/wok/ $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem touch $(DESTDIR)/etc/nginx/conf.d/wok.conf + mkdir -p $(DESTDIR)/etc/logrotate.d/ + $(INSTALL_DATA) $(top_srcdir)/contrib/wokd.logrotate $(DESTDIR)/etc/logrotate.d/wokd
uninstall-local: @if test -f $(systemdsystemunitdir)/wokd.service; then \ diff --git a/contrib/Makefile.am b/contrib/Makefile.am index ed4a006..2939bc9 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -29,6 +29,7 @@ EXTRA_DIST = \ wokd-upstart.conf.debian \ wokd-upstart.conf.fedora \ make-deb.sh.in \ + wokd.logrotate \ $(NULL)
make-deb.sh: make-deb.sh.in $(top_builddir)/config.status diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in index 34b3ac3..feea7f1 100644 --- a/contrib/wok.spec.fedora.in +++ b/contrib/wok.spec.fedora.in @@ -116,6 +116,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/wok/wok.conf %{_sysconfdir}/wok/ +%{_sysconfdir}/logrotate.d/wokd %{_mandir}/man8/wokd.8.gz
%if 0%{?with_systemd} diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in index aab4a80..fa477e1 100644 --- a/contrib/wok.spec.suse.in +++ b/contrib/wok.spec.suse.in @@ -93,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/wok/ %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/nginx/conf.d/wok.conf +%{_sysconfdir}/logrotate.d/wokd %{_var}/lib/wok/ %{_localstatedir}/log/wok/* %{_localstatedir}/log/wok/ diff --git a/contrib/wokd.logrotate b/contrib/wokd.logrotate new file mode 100644 index 0000000..2a03106 --- /dev/null +++ b/contrib/wokd.logrotate @@ -0,0 +1,30 @@ +# +# Project Wok +# +# Copyright IBM Corp, 2016 +# +# Code derived from Project Kimchi +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +/var/log/wok/*log { + daily + maxsize 1024k + rotate 10 + missingok + compress + sharedscripts +} +
-- Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com

On Thu, 2016-01-14 at 15:13 -0200, Ramon Medeiros wrote:
Use logrotate to compress and keep 10 logs of 1MB If i get it right after 10mb of log files, the log files will start getting overwritten?
If that is the case, just a curious thought, we will start loosing the logs if the entries not happen in 10MB. Say customer is doing high activities that lead to log full quickly, then we might loose the debug log that might have useful data. Can we have something like once these 10 files are written, zip them and create a tar files say log1.tar till log5.tar. Which means we will have 10MB * 5 =50mb of log files. We had this experience in AIX, and we were forced to store more debug data.
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- Makefile.am | 2 ++ contrib/Makefile.am | 1 + contrib/wok.spec.fedora.in | 1 + contrib/wok.spec.suse.in | 1 + contrib/wokd.logrotate | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 contrib/wokd.logrotate
diff --git a/Makefile.am b/Makefile.am index 278bda1..6d4c574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,6 +140,8 @@ install-data-local: mkdir -p $(DESTDIR)/etc/wok/ $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem touch $(DESTDIR)/etc/nginx/conf.d/wok.conf + mkdir -p $(DESTDIR)/etc/logrotate.d/ + $(INSTALL_DATA) $(top_srcdir)/contrib/wokd.logrotate $(DESTDIR)/etc/logrotate.d/wokd
uninstall-local: @if test -f $(systemdsystemunitdir)/wokd.service; then \ diff --git a/contrib/Makefile.am b/contrib/Makefile.am index ed4a006..2939bc9 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -29,6 +29,7 @@ EXTRA_DIST = \ wokd-upstart.conf.debian \ wokd-upstart.conf.fedora \ make-deb.sh.in \ + wokd.logrotate \ $(NULL)
make-deb.sh: make-deb.sh.in $(top_builddir)/config.status diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in index 34b3ac3..feea7f1 100644 --- a/contrib/wok.spec.fedora.in +++ b/contrib/wok.spec.fedora.in @@ -116,6 +116,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/wok/wok.conf %{_sysconfdir}/wok/ +%{_sysconfdir}/logrotate.d/wokd %{_mandir}/man8/wokd.8.gz
%if 0%{?with_systemd} diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in index aab4a80..fa477e1 100644 --- a/contrib/wok.spec.suse.in +++ b/contrib/wok.spec.suse.in @@ -93,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/wok/ %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/nginx/conf.d/wok.conf +%{_sysconfdir}/logrotate.d/wokd %{_var}/lib/wok/ %{_localstatedir}/log/wok/* %{_localstatedir}/log/wok/ diff --git a/contrib/wokd.logrotate b/contrib/wokd.logrotate new file mode 100644 index 0000000..2a03106 --- /dev/null +++ b/contrib/wokd.logrotate @@ -0,0 +1,30 @@ +# +# Project Wok +# +# Copyright IBM Corp, 2016 +# +# Code derived from Project Kimchi +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +/var/log/wok/*log { + daily + maxsize 1024k + rotate 10 + missingok + compress + sharedscripts +} +

On 01/22/2016 06:22 PM, Abhiram wrote:
On Thu, 2016-01-14 at 15:13 -0200, Ramon Medeiros wrote:
Use logrotate to compress and keep 10 logs of 1MB If i get it right after 10mb of log files, the log files will start getting overwritten?
If that is the case, just a curious thought, we will start loosing the logs if the entries not happen in 10MB. Say customer is doing high activities that lead to log full quickly, then we might loose the debug log that might have useful data.
Can we have something like once these 10 files are written, zip them and create a tar files say log1.tar till log5.tar. Which means we will have 10MB * 5 =50mb of log files.
We had this experience in AIX, and we were forced to store more debug data.
This is the first patch of this change, there is a v2 in the list. We moved to 10MB, do you think it's enough?
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- Makefile.am | 2 ++ contrib/Makefile.am | 1 + contrib/wok.spec.fedora.in | 1 + contrib/wok.spec.suse.in | 1 + contrib/wokd.logrotate | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 contrib/wokd.logrotate
diff --git a/Makefile.am b/Makefile.am index 278bda1..6d4c574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,6 +140,8 @@ install-data-local: mkdir -p $(DESTDIR)/etc/wok/ $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem touch $(DESTDIR)/etc/nginx/conf.d/wok.conf + mkdir -p $(DESTDIR)/etc/logrotate.d/ + $(INSTALL_DATA) $(top_srcdir)/contrib/wokd.logrotate $(DESTDIR)/etc/logrotate.d/wokd
uninstall-local: @if test -f $(systemdsystemunitdir)/wokd.service; then \ diff --git a/contrib/Makefile.am b/contrib/Makefile.am index ed4a006..2939bc9 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -29,6 +29,7 @@ EXTRA_DIST = \ wokd-upstart.conf.debian \ wokd-upstart.conf.fedora \ make-deb.sh.in \ + wokd.logrotate \ $(NULL)
make-deb.sh: make-deb.sh.in $(top_builddir)/config.status diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in index 34b3ac3..feea7f1 100644 --- a/contrib/wok.spec.fedora.in +++ b/contrib/wok.spec.fedora.in @@ -116,6 +116,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/wok/wok.conf %{_sysconfdir}/wok/ +%{_sysconfdir}/logrotate.d/wokd %{_mandir}/man8/wokd.8.gz
%if 0%{?with_systemd} diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in index aab4a80..fa477e1 100644 --- a/contrib/wok.spec.suse.in +++ b/contrib/wok.spec.suse.in @@ -93,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/wok/ %{_sysconfdir}/nginx/conf.d/wok.conf.in %{_sysconfdir}/nginx/conf.d/wok.conf +%{_sysconfdir}/logrotate.d/wokd %{_var}/lib/wok/ %{_localstatedir}/log/wok/* %{_localstatedir}/log/wok/ diff --git a/contrib/wokd.logrotate b/contrib/wokd.logrotate new file mode 100644 index 0000000..2a03106 --- /dev/null +++ b/contrib/wokd.logrotate @@ -0,0 +1,30 @@ +# +# Project Wok +# +# Copyright IBM Corp, 2016 +# +# Code derived from Project Kimchi +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +/var/log/wok/*log { + daily + maxsize 1024k + rotate 10 + missingok + compress + sharedscripts +} +
-- Ramon Nunes Medeiros Kimchi Developer Linux Technology Center Brazil IBM Systems & Technology Group Phone : +55 19 2132 7878 ramonn@br.ibm.com
participants (4)
-
Abhiram
-
Aline Manera
-
Paulo Ricardo Paz Vital
-
Ramon Medeiros