-
1. Re: How to add entry for GC logs in log4j in Jboss?
peterj Mar 3, 2010 10:19 AM (in response to your_shadow03)This cannot be done. The GC data is generated by the JVM (within the C/C++ code in which the JVM is written). There is no way to identify this data within a logging config file.
By the way, you should not have -verbose:gc or any of the other GC data generating options set constantly in production. You should use them only for load or performance testing. Setting them in production for a day or two is fine for gathering data to validate your performance testing results or to fine tune the performance. But after that you should turn those options off and use a monitoring tool to monitor the heap size, if that is really of concern.
-
2. Re: How to add entry for GC logs in log4j in Jboss?
your_shadow03 Mar 3, 2010 11:48 AM (in response to peterj)You mean noone ever wrote an entry into log4j for GC.
I need temporary solution for the same.
Just searching for a method which can remove the first line.
Can't it be possible to remove the first line from log file without loosing the pipe.
Also, Look at this link.Someone do have faced such issues http://serverfault.com/questions/71341/why-do-jboss-and-logrotate-create-log-files-full-of-nul-characters
-
3. Re: How to add entry for GC logs in log4j in Jboss?
peterj Mar 3, 2010 1:37 PM (in response to your_shadow03)You can probably get rid of the ^@^@^@ by changing the code page used by the JVM, or change the localization setting. But that change would apply globally to the JVM and might adversly effect the apps running in the app server. I would just learn to live with the characters and realize that they are there. I would also look for an editor that will handle files with those characters.
The link you posted is in regards to the server.log file and has nothing ot do with the GC log.
-
4. Re: How to add entry for GC logs in log4j in Jboss?
your_shadow03 Mar 3, 2010 2:10 PM (in response to peterj)Thanks for the response.
As I am newbie to Jboss, I maynot be able to understand what you said.
But What I tried is getting rid of the log.
like:
cat /dev/null > gc.log
But seems that it wont work on data format (BINARY) file .
I tried with ASCII format file like /var/log/messages
and that worked !!!
Any idea how can we make it for data format file.
As you recommended, can you suggest me what changes I need to make.
I did tried with wtmp file which is again data format.
dd-command http://www.sunmanagers.org/archives/1995/0684.html as suggested.
But wonder how to put that for our environment.
-
5. Re: How to add entry for GC logs in log4j in Jboss?
peterj Mar 4, 2010 11:08 AM (in response to your_shadow03)"As I am newbie to Jboss,"
This discussion has nothing whatsoever to do with JBoss AS. This issue is entirely with the JVM. Are you a newbie to Java?
I have no idea why "cat /dev/null > xxx.log" does not clear out the log. I suspect you are doing this because you have logging turned on continuously in production. You should not be doing that, like I have already stated.
-
6. Re: How to add entry for GC logs in log4j in Jboss?
your_shadow03 Mar 4, 2010 12:05 PM (in response to peterj)You can probably get rid of the ^@^@^@ by changing the code page used by the JVM, or change the localization setting.
Peter,
Can you elaborate what you are trying to say with those lines.
I cant let those characters there .Why? Becuase everyday our support Team are deleting it manually as we have been receiving alerts through our tools.The size really goes up consuming more and more space.
So we cant let it be there.
One Quick Question:
I can see that when the log gets rotated it created gc_log.0 which is ASCII file while gc_log remains data file.
No idea why its behaving so. But thats what happening at our end.
Anyway We can take control and get rid of those logs.
-
7. Re: How to add entry for GC logs in log4j in Jboss?
sviluppatorefico Mar 6, 2010 5:21 AM (in response to your_shadow03)Anyhow it is not the correct thred. You can continue the discussion here:
http://community.jboss.org/en/jbossas/config
or:
http://community.jboss.org/en/jbossas/beginners
The thread will be soon deleted
-
8. Re: How to add entry for GC logs in log4j in Jboss?
jaikiran Mar 6, 2010 5:52 AM (in response to sviluppatorefico)Moving to "Installation, Configuration and Deployment" forum