[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[master] logging: remote logging for traceback dumps.



Because the names of the traceback files are not known in advance and
there can be many of them, this patch appends every new traceback into
/tmp/anaconda-tb-all.log. This file is then forwarded over.

Related: rhbz#576439.
---
 pyanaconda/__init__.py |   10 +++++++++-
 scripts/analog         |   31 +++++++++++++++++--------------
 scripts/mk-images      |    6 ++++++
 3 files changed, 32 insertions(+), 15 deletions(-)

diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index 9bb097c..1119d8a 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -207,10 +207,18 @@ class Anaconda(object):
         stack.reverse()
         exn = ReverseExceptionDump((None, None, stack), self.mehConfig)
 
+        # dump to a unique file
         (fd, filename) = mkstemp("", "anaconda-tb-", "/tmp")
         fo = os.fdopen(fd, "w")
-
         exn.write(self, fo)
+        fo.close()
+
+        #append to a given file
+        with open(filename, "r") as f:
+            content = f.readlines()
+        with open("/tmp/anaconda-tb-all.log", "a+") as f:
+            f.write("--- traceback: %s ---\n" % filename)
+            f.writelines(content)
 
     def initInterface(self):
         if self._intf:
diff --git a/scripts/analog b/scripts/analog
index ae3ca2d..af7b0f6 100755
--- a/scripts/analog
+++ b/scripts/analog
@@ -66,6 +66,7 @@ $template anaconda_syslog, "%%timestamp:8:$:date-rfc3164%%,%%timestamp:1:3:date-
 
 $template path_syslog, "%(directory)s/%(subdirectory)s/syslog
 $template path_anaconda, "%(directory)s/%(subdirectory)s/anaconda.log"
+$template path_anaconda_tb, "%(directory)s/%(subdirectory)s/anaconda-tb-all.log"
 $template path_program, "%(directory)s/%(subdirectory)s/program.log"
 $template path_storage, "%(directory)s/%(subdirectory)s/storage.log"
 $template path_xserver, "%(directory)s/%(subdirectory)s/X.log"
@@ -75,23 +76,25 @@ $template path_sysimage, "%(directory)s/%(subdirectory)s/install.log.syslog"
 
 kern.*;\\
 daemon.*;\\
-authpriv.*                                           ?path_syslog;anaconda_syslog
+authpriv.*                                          ?path_syslog;anaconda_syslog
 
-:programname, contains, "loader"                     ?path_anaconda;anaconda_syslog
-:programname, contains, "anaconda"                   ?path_anaconda;anaconda_syslog
-:programname, contains, "program"                    ?path_program;anaconda_syslog
-:programname, contains, "storage"                    ?path_storage;anaconda_syslog
-:programname, contains, "xserver"                    ?path_xserver;anaconda_justmsg
-:hostname, contains, "sysimage"                      ?path_sysimage;anaconda_syslog
+:programname, isequal, "loader"                     ?path_anaconda;anaconda_syslog
+:programname, isequal, "anaconda"                   ?path_anaconda;anaconda_syslog
+:programname, isequal, "anaconda-tb"                ?path_anaconda_tb;anaconda_justmsg
+:programname, isequal, "program"                    ?path_program;anaconda_syslog
+:programname, isequal, "storage:"                   ?path_storage;anaconda_syslog
+:programname, isequal, "xserver"                    ?path_xserver;anaconda_justmsg
+:hostname, isequal, "sysimage"                      ?path_sysimage;anaconda_syslog
 
 # discard those that we logged
-:programname, contains, "rsyslogd"                   ~
-:programname, contains, "loader"                     ~
-:programname, contains, "anaconda"                   ~
-:programname, contains, "program"                    ~
-:programname, contains, "storage"                    ~
-:programname, contains, "xserver"                    ~
-:hostname, contains, "sysimage"                      ~
+:programname, isequal, "rsyslogd"                    ~
+:programname, isequal, "loader"                      ~
+:programname, isequal, "anaconda"                    ~
+:programname, isequal, "anaconda-tb"                 ~
+:programname, isequal, "program"                     ~
+:programname, isequal, "storage"                     ~
+:programname, isequal, "xserver"                     ~
+:hostname, isequal, "sysimage"                       ~
 kern.*                                               ~
 daemon.*                                             ~
 authpriv.*                                           ~
diff --git a/scripts/mk-images b/scripts/mk-images
index 7eb1b68..43dba94 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -808,6 +808,12 @@ $ModLoad imfile
 $InputFileName /tmp/X.log
 $InputFileTag xserver:
 $InputFileStateFile xserver-statefile
+$InputFileFacility local1
+$InputRunFileMonitor
+$InputFileName /tmp/anaconda-tb-all.log
+$InputFileTag anaconda-tb:
+$InputFileStateFile anaconda-tb-statefile
+$InputFileFacility local1
 $InputRunFileMonitor
 
 #### GLOBAL DIRECTIVES ####
-- 
1.7.1.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]