Using log4j.xml to limit the size of a file

Hello,
I'm using JBoss. On startup it writes to boot.log and server.log. I'd like to limit the size that server.log can reach. At the minute I'm using the following code:
<!-- A size based file rolling appender-->
   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
     <param name="File" value="${jboss.server.home.dir}/log/server.log"/>
     <param name="Append" value="false"/>
     <param name="MaxFileSize" value="3KB"/>
     <param name="MaxBackupIndex" value="1"/>
     <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
     </layout>        
   </appender>However this causes far more information to be written to boot.log than usual and nothing to server.log.
Can anyone help me in where I'm going wrong?
Thanks very much,
Ger

Solved.
Thanks,
Ger
Tell me more...

Similar Messages

  • How do I check/limit the size of a file

    I am logging data to a file periodically. Since the PC is at a remote site, and I download the data file via modem, I want to limit the size of the file by automatically starting a new file once the current file reaches a certain size (in kB) limit. This way I minimize download time as well as avoid downloading the same data over and over again if I keep the same filename.
    How can I do this? Thanks.

    There is a function on the File I/O>Advanced File Functions called File/Directory Info. The functions returns the file size in bytes.

  • How can I limit the size of a file upload?

    I am uploading a file using a file reference using the code below.  I want to  limit the file size (bytes) of the uploaded file to 100k, so that a huge file won't crash the browser or my SWF.
    What's the best place in the following process to test this, and actually prevent the large file from being loaded?  Is that even possible?
    private function uploadImageBtn_clickHandler() : void {
         var arr:Array = [];
         arr.push(new FileFilter("Images", "*.gif;*.jpeg;*.jpg;*.png"));
         fileRef.browse(arr);
    private function fileReference_select(evt:Event):void {
         fileRef.load();
    private function fileReference_complete(event:Event):void {
         var loader:Loader = new Loader();
         loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
         loader.loadBytes(fileRef.data);
    public function loader_complete (event:Event) : void {
         trace("Loader info = "+event.currentTarget.bytesLoaded); // file size in bytes
         var sourceBMP:Bitmap = event.currentTarget.loader.content as Bitmap;
         bgImage.source = sourceBMP; 

    Thank you. I just needed to be pointed in the right direction. After looking over this stuff, including FilePermission, I think this may give me what I was looking for. It will be a while before I get to implementing it or testing something like this, I'm just trying to get a grasp on all of the things I need to do and how to approach it.
    By doing this I can control how much filespace it can use.
    I can control CPU usage by monitoring for extra threads that don't belong and killing or settings the priority on it.
    Now I just need to think of something to monitor how much memory the plugin uses. I suppose I could gc, then store the current memory usage, then execute the plugin, gc again, and measure the size again. Does that sound like a reasonable way to estimate it's memory usage? I'm not looking for tiny changes, I just want to see large, substantial increases.

  • How can I limit the size of a file generated by 3rd party code?

    I have a program that loads plugins from a directory and executes code in those plugins. These plugins are classes that implement a standard interface within my API. I want to be able to monitor for files generated by these plugins. Usually there are no more than 2 plugins running at once, so I could end up with 2 plugins writing files. An example would be a plugin creating an SQLite database on the filesystem.
    I could monitor the current directory and guess who's file it is, but what if the files get written elsewhere? Can I do something in Java that limits what directories the Java process can write to?
    I wouldn't mind being able to track their memory and CPU usage, but I don't think I can do much about that.

    Thank you. I just needed to be pointed in the right direction. After looking over this stuff, including FilePermission, I think this may give me what I was looking for. It will be a while before I get to implementing it or testing something like this, I'm just trying to get a grasp on all of the things I need to do and how to approach it.
    By doing this I can control how much filespace it can use.
    I can control CPU usage by monitoring for extra threads that don't belong and killing or settings the priority on it.
    Now I just need to think of something to monitor how much memory the plugin uses. I suppose I could gc, then store the current memory usage, then execute the plugin, gc again, and measure the size again. Does that sound like a reasonable way to estimate it's memory usage? I'm not looking for tiny changes, I just want to see large, substantial increases.

  • How to limit the size of bounced messages

    Hi,
    how can i limit the size of bounced messages?
    In most cases, we have users which accounts are over quota, the mail bounces and is returned.
    How can i limit the size of the returned message to a maximum size of 1MB?
    We're using
    iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)
    libimta.so 5.2 HotFix 2.02 (built 13:42:55, Oct 21 2004)
    thx,
    ghfg

    Ah. found it. It is indeed in 5.2
    http://docs.sun.com/source/816-6009-10/mta.htm#24585
    look down the page, and find:
    CONTENT_RETURN_BLOCK_LIMIT
    this when put in the option.dat file will limit your response to the
    CONTENT_RETURN_BLOCK_LIMIT=
    number of 1k blocks.

  • I want to be able to paste a bunch of text into the subject line buit to only keep the first maybe 50 characters. How can I limit the size of the subject line?

    I need the ability to paste a bunch of text into the subject line but for it only to capture the first 50 or x number of characters. Can I limit the size of the subject line characters somehow in an ini or profile setting?

    If your problem is with Mozilla Thunderbird, see this forum for support.
    [https://support.mozillamessaging.com/en-US/home] <br />
    or this one <br />
    [http://forums.mozillazine.org/viewforum.php?f=39]

  • Hi.  Is there a way to limit the size of the emails I receive?

    Hi.
    Is there a way to limit the size of the emails I receive?   Can I set my iPhone4s to only download headers or set a limit to the size?   I can't see anything in the settings.
    Thanks,
    John

    My Gmail downloads only small embedded pictures. For videos and other big files I have to tap to download and this is a temp download. So you don't have any problem I thing. You can Delete the account-restart-add account back from time to time.

  • Is there a way to limit the size of the page preview cache?

    Overall I think that the page preview function of Safari is really great. But I noticed today that Safari was becoming slow to close down, and I cleared the page previews with the "Reset Safari" function, and over 1 GB of cache was cleared up. I had no idea that that much disk space could be taken up by the page previews.
    Is there a way to limit the size of the Safari Page Preview cache to, say, 500MB?

    Sorry, you can't limit the size of that item; you can either delete it, or disable it completely (which will also disable Top Sites and Cover Flow for Safari).

  • HT4889 When I transferred my data from a 128GB Macbook Air to 256GB Macbook Air (brand new version as of 9/1/13) I end up with 188GB used!   I add up the size of Users, System, Library and Applications and it comes to 90GB.  What am I missing?

    When I transferred my data from a 128GB Macbook Air to 256GB Macbook Air (brand new version as of 9/1/13) I end up with 188GB used!   I add up the size of Users, System, Library and Applications and it comes to 90GB.  What am I missing?  How did I "use" up so much space in migrating from one Mac to another?

    Did you use the Setup Assistant available at the beginning of the new machine's setup process? Or did you use Migration Assistant later after you had set up the new machine?
    If you used Migration Assistant, you generally wind up with two accounts (the new one you set up on the new machine plus the old one you ported over) - that may explain your excessive use of space. In that case, you can either manually combine/remove all unnecessary duplicate files, or you can start over by using Command + R, wiping your drive, and downloading the OS. Once it's downloaded, use the Setup Assistant offered at the beginning of the install/setup process.

  • How to limit the size of large core file

    These days in my project I am facing big trouble of large core files .
    I want to limit the size of the core file .
    Please help for same .
    Regards ,
    Abhi

    Hi Abhishek,
    You can explain more.
    OS?
    DB?
    SAP Version?
    /usr/sap/SID/DVEBMGS00/work/
    SAP folder is full and creating issue.
    Regards,
    V Srinivasan

  • How to limit the size of the connection method parameter

    I connected an FMS server like var nc = new NetConnection ();
                                                      nc.connect ("rtmfp :/ / localhost: 61018/zy/1", a);
    But how to restrict the size of the parameter a, assuming that this a set to a 10GB object, or a very large byte, I found that the server received. This allows the hacker attacks, Is there any way to limit the size of this a, I hope that does not exceed 100KB.

    RTMFP encodes low-level messages in a manner compatible with RTMP messages. RTMP messages are length-field limited to 16MB (24 bits), and there is an artificial software limit somewhat less than that (approximately 10MB if i recall correctly).
    it should not be possible to send a connect message to an RTMFP or RTMP server exceeding about 10MB.
    ByteArray is limited to 4GB, and can't be serialized to AMF beyond 512MB (29 bits).
    also keep in mind that for an RTMFP or RTMP server to receive such a large message, that many bytes must be sent to it from somewhere (you).

  • How to limit the size of a log file.

    Hi,
    I am developing an application that creates a log file with all actions that take place. My problem is that this log file grows a lot because the application acts as a server that is up 24 hours a day. For that reason, I wanted to limit the size of the log file by deleting de older lines, how can implement is?
    Thanks.

    One way is to periodically (say every week) create a new file to store the actions and then, when the space taken up by all the files is too large, delete the oldest one.
    You can also have your application periodically (say the first time you write to the file on any calendar day) check the size of the file and, when it gets too big, copy all of the actions in the file after a given time (presumably there is an associated timestamp with each action) to a new file. Then delete the old file.

  • Limit the size of time machine back ups

    I would like to limit the size of my time machine back ups on time capsule.  How can I do this?  I am running the latest OS with the new time capsule.
    Please help!!
    Thanks,

    Try setting the max size of the sparsebundle.
    http://pondini.org/TM/A8.html

  • How can I get the size of a file with apple script

    I try to get the size of a file within an apple script. But I did not find information how to do this.

    There are two ways. I think Apple is moving toward using System Events, which is listed first.tell application "Finder"
    set myFile to selection as alias
    --this just gets a file for me to work with
    --coercing it into an alias is required for the other functions
    end tell
    tell application "System Events"
    get size of myFile
    end tell
    set myInfo to (info for myFile)
    get size of myInfo

  • HT3669 I only have a HP printer and why I need to install a file for all the HP printers drivers 590MB??? if normally the size of my file should be 5MB.  some one could me help to avoid installation of 590MB for my new mountain lion software???

    Hi guys..!!
    I would like to know if someone could help on this:
    I just have a HP printer (HP Designjet 100) and for some reason I need to install a file for all the HP printers drivers in total 590MB to be able to use my printer in my mountain lion???
    If normally the size of my files in the for previous software was more or less 5MB why now i need to install 590?
    Some one could help me how to avoid installation of 590MB for my new mountain lion software???
    Thanks

    If you go to http://support.apple.com/downloads and locate the HP Printer Drivers installer, you will find that it is 473.4 MB (for version 2.11). If you install this, it will install the full set of drivers for every model of HP printer that is supported by the drivers distributed through Apple. The disk space occupied once installed will probably be larger than the download, since the downloaded file is compressed.
    On the other hand, if you have an HP printer connected and you use Software Update (or the Update tab in App Store), that should offer you a much smaller set of HP drivers, which are only applicable to your printer (and possibly a few similar ones). These updates are typically only tens of megabytes rather than hundreds of megabytes.
    If Software Update doesn't offer you any HP drivers then it either thinks you have the latest drivers installed already, or the printer model is not supported by the drivers available from Apple.
    This article lists all of the printer models for which Apple distributes the driver:
    http://support.apple.com/kb/HT3669

Maybe you are looking for

  • Making the Route field mandatory on an STO

    All,      Does anyone know how to make the route mandatory on a stock transport order?  It doesn't seem to be in the screen control. Thanks!

  • Connecting directly to camera

    i have a panasonic dmc-fs3 digital camera and would like to use the ipod touch to download pictures when i am on a trip. since i am away from home i would most likely not have a computer to connect with and go thru the process of using itunes to down

  • Pre intel iBook

    I have just ordered a new MacBook Pro and am waiting for it to arrive. I am unsure what my options are with my old pre-intel iBook G3 It came loaded with the first version of OS9 and the first version of OSX. I booted into OSX once years ago but hone

  • Automatically moving a row of data on cell entry

    I have a worksheet with several rows of data.  One of the columns has a data list of "status"es from a drop down list box.  I have conditional formatting on the rows so that when the status is "Completed", the entire row goes to a soft grey font.  I

  • Translation Builder : XBD-00024

    When trying to add a new project in Translation Builder after the database connection created, I got the error XBD-00024: Translation Builder tables not found. The action is 'Go to the Forms Developer Administration program group, double-click on the