14 Replies Latest reply on Jul 22, 2008 1:41 PM by peterj

    How do I stop jboss from writing to the log folder?

    tamalak

      I'd like to prevent jboss from writing to the server\default\log at all. How can I do this? Thank you!

        • 1. Re: How do I stop jboss from writing to the log folder?
          peterj

          Edit server/xxx/conf/jboss-log4j.xml, remove the FILE appender, and all references to that appender.

          • 2. Re: How do I stop jboss from writing to the log folder?
            tamalak

            Hmm.. I tried removing the FILE appender WITHOUT removing the references to it.. and what happened is that the only file that got written to in the log folder was boot.log. However, boot.log eventually grew to like 5 gigabytes which is not good.

            I only found one reference to the FILE and removed that now, however it still opens and writes to a boot.log file in my log folder. Will it grow out of control again?

            • 3. Re: How do I stop jboss from writing to the log folder?
              peterj

              Never having tried this before, I did not realize that the boot logger would continue to be used if the file logger did not replace it. The boot logger is a little more difficult to configure - you need to edit the log4j.properties file (there are three of them, you might have to edit all of them) in the bin/run.jar file.

              • 4. Re: How do I stop jboss from writing to the log folder?
                tamalak

                Never mind, it was improperly commented out to begin with.. I'll get back to you :)

                Thanks!

                • 5. Re: How do I stop jboss from writing to the log folder?
                  tamalak

                  Oh, it sounds like this will continue to be a problem, then?

                  I don't even see any log4j.properties file in my conf folder..

                  • 6. Re: How do I stop jboss from writing to the log folder?
                    tamalak

                    Oh, I'm stupid, it's in my run.jar file? I don't even know how to open this :(

                    I have a "Java 2 Platform Standard Edition Binary" that is in my Open With options, but opening with this does nothing. It seems to load something but nothing comes up..

                    I have eclipse, if that's how you open it...

                    • 7. Re: How do I stop jboss from writing to the log folder?
                      peterj

                      On Windows, I use WinZip to open JAR files (and WAR, EAR., etc). Works great. On Linux, I rename the file to *.zip and then Konqueror is happy to open it for me.

                      So I use that to unpack the file, make my changes, and then pack it up again. Make sure when you pack it up again that you have the correct base directory.

                      Or if you want to avoid gui tools, you can always use the jar utility (in the jdk bin directory) to pack and unpack it.

                      And no you cannot do this in Eclipse (or at least I would not).

                      • 8. Re: How do I stop jboss from writing to the log folder?
                        tamalak

                        Awesome.. I unzipped them and opened the properties files using notepad. All three properties files are pretty similar, they look something like:

                        ### ====================================================================== ###
                        ## ##
                        ## JBoss Bootstrap Log4j Configuration ##
                        ## ##
                        ### ====================================================================== ###

                        ### $Id: log4j.properties,v 1.3 2002/07/12 21:52:36 user57 Exp $ ###

                        log4j.rootCategory=DEBUG, FILE, CONSOLE

                        ### A bootstrap file appender
                        log4j.appender.FILE=org.jboss.logging.appender.FileAppender
                        log4j.appender.FILE.File=${jboss.server.home.dir}/log/boot.log
                        log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
                        log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
                        log4j.appender.FILE.Append=false

                        log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
                        log4j.appender.CONSOLE.Threshold=INFO
                        log4j.appender.CONSOLE.Target=System.out
                        log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
                        log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n




                        ..So what do I do, just comment out the FILE lines with #s?

                        • 9. Re: How do I stop jboss from writing to the log folder?
                          peterj

                          Yes, same instructions as before. - remove appender, remove all refs to FILE.

                          • 10. Re: How do I stop jboss from writing to the log folder?
                            tamalak

                            I don't know what refs to file mean in this case.. should I edit that first line with "DEBUG, FILE, CONSOLE" so that it only says "DEBUG, CONSOLE"?

                            Does this look right:

                            ### ====================================================================== ###
                            ##

                            ##
                            ## JBoss Bootstrap Log4j Configuration

                            ##
                            ## ##
                            ###

                            ====================================================================== ###

                            ### $Id: log4j.properties,v 1.3

                            2002/07/12 21:52:36 user57 Exp $ ###

                            log4j.rootCategory=DEBUG, CONSOLE

                            ### A bootstrap file appender
                            #log4j.appender.FILE=org.jboss.logging.appender.FileAppender
                            #log4j.appender.FILE.File=${jboss.server.home.dir}/log/boot.log
                            #log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
                            #log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
                            #log4j.appender.FILE.Append=false

                            log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
                            log4j.appender.CONSOLE.Threshold=INFO
                            log4j.appender.CONSOLE.Target=System.out
                            log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
                            log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n

                            • 11. Re: How do I stop jboss from writing to the log folder?
                              peterj

                              Did you try it? Did it work?

                              • 12. Re: How do I stop jboss from writing to the log folder?
                                tamalak

                                We're trying it but I'm not in charge of testing.. I'll know tomorrow..

                                • 13. Re: How do I stop jboss from writing to the log folder?
                                  tamalak

                                  It seems to be working! WOOHOO!

                                  We had some problems at first because we were zipping it up as a .rar and not as a .zip. Apparently the .rar to .jar translation is not good, but .zip to .jar worked fine.

                                  Thanks a lot!!

                                  • 14. Re: How do I stop jboss from writing to the log folder?
                                    peterj

                                    Yes, .rar uses a different, incompatible, compression algorithm. The .zip compression algorithm is compatible with .jar, .war, etc.