How to Monitor the size of log file (Log4j) During its Generation.

i have made a program using log4j technology. Now i want to know that is there any method that i can restrict the size of the log file. for example if the size of generating log file exceeds the restricted size then it should be placed in backup and a new file should be automatically generate and remaining contents should be written in that file.
is there any method that can monitor the size of file during the generation of that (say) log file.
Waiting for ur Urgent response

I have wrote that code
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="appender" class="org.apache.log4j.FileAppender">
<param name="File" value="c:\\abc.txt"/>
<param name="MaxFileSize" value="100B"/>
<param name="MaxBackupIndex" value="3"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.SimpleLayout"></layout>
</appender>
<root>
<priority value ="debug"/>
<appender-ref ref="appender"/>
</root>
</log4j:configuration>
When i run it it gave me error Message
log4j:WARN No such property [maxFileSize] in org.apache.log4j.FileAppender.
log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.FileAppender.

Similar Messages

  • How to change the size of redo file

    Deal all,
    I finish installed the db,and the size of redo file is 50m by default. I found many "checkpoint not complete" events in alert.log file.
    Now i want to change it to 100M and try to avoid the event appear again ,how can i do?

    As Sb has already correct reply that size of redo logs can not be changed. We have to create new bigger/smaller size of redo logs and then 'alter system switch logfile' to inactivate older logs. Now you can drop older logs. Redo logs are something a glass of water. We can not change the size of glass, if we wish to dring more/less water, we will take that sized glass and we will get that sized water.
    Remember to consider the multiplexing/grouping when doing any maintenance like this. And there may be archive log & backup space considerations.
    Hans @ http://dbaspot.com/oracle-server/33231-changing-redo-log-file-size.html
    Regards
    Girish Sharma

  • How to correct the corrupted archive log files?

    Friends,
    Our restore method is cloning type.
    today i fired this statement(this is one is usually do for the restore) "recover database until cancel using backup controlfile"
    i have 60 files in the archive folder.
    it executs only 50 files when it comes to 51st file it came out and says could not copy the file.
    is that particular file is corrupted?
    or is there any restriction in copying no of archivelog files? i mean only 60 files like that.....
    suppose if the archive file is corrupted how can i correct it?
    thanks
    sathyguy

    Now, this is the error message....
    ORA-00310: archived log contains sequence 17480; sequence 17481 required
    ORA-00334 archived log; '/archive2/OURDB/archive/ar0000017481.arc'i googled....and find out.....
    ORA-00310 archived log contains sequence string; sequence string required
    Cause: The archived log is out of sequence, probably because it is corrupted or
    the wrong redo log file name was specified during recovery.
    Action: Specify the correct redo log file and then retry the operation.so...from the above error messages.....i think the particular archive file(17481) is corrupted. now can i correct this corrupted archive file.
    According to the above action, it says to specify the correct redo log file. if the file is not corrupted then where should i specify the redo log file's path?
    thanks
    sathyguy

  • How to find the size of a file or folder

    How can I find the size of a file or folder?
    I am trying to determine the size of my iPhoto and Mail folder.
    It says "Size: --" under general from Get Info.

    It's working fine...
    When you ask for that info, and Finder presents those '--' dashes instead of a value, actually, Finder is calculating the value in background.
    That's something that i recently noticed and wonder why tha heck he needs to do all that work by himself, kinda re-inventing the wheel of file size value "calculus"...
    I posted some thoughts about it here: File / Folder size... How do Finder gets it?
    Will appreciate feedback about this!
    Props!

  • How to know the size of a file in a program ?

    I am compiling a program and I have to use a function in Java to know the size of some files. How can I do? Thanks

    File.length() not good enough?

  • How to determine the size of a file on application server

    Hello,
    using open dataset I have created a file on the application server and have put some data into the file.
    Now I want to know the size of this file.
    Is there a function module to do this ?
    Best regards
    Michael

    Hi,
    Use Function module   'EPS_GET_FILE_ATTRIBUTES'
    DATA fsize TYPE epsf-epsfilsiz.
    CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
      EXPORTING
        file_name =     " here provide filename
        dir_name  =    "  here provide directory
      IMPORTING
        file_size = fsize.
    WRITE: 'File size' , fsize.
    Regards,
    Ravi

  • How to monitor the size of message payload processed

    Hi all,
    where could i find the size of the message payload processed in monitor?
    i want to check the volumn of the payload, such as how much kb
    thanks in advance

    Hi,
    ths payload size in KB can be found from the audit logs of the adapter monitoring (Runtime workbench ).
    it will tell you the exact size of the files processed through the adapter.
    Cheers,
    Sunil.

  • How to get the size of a file DONE

    How can I get the size a file? I want to do the following....
    File clobDataFile = new File("clob.dat");
    PrintWriter clobpw = new PrintWriter(new BufferedWriter(new FileWriter(clobDataFile)));
    int               offset     = //get the number of chars in the fileOk I am a tard... figured it out...
    File clobDataFile = new File("clob.dat");
    PrintWriter clobpw = new PrintWriter(new BufferedWriter(new FileWriter(clobDataFile)));
    int               offset     =colbDataFile.length();

    read API http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#length()
    next time you have a similar question please refer this document

  • How to estimate the size of dump file

    Hi,
    I would like to export my full database.
    My database size is nearly 50G.
    How to know how much space the export dump will occupy?
    Thanks,
    Kavitha

    SELECT SUM(AVG_ROW_LEN * NUM_ROWS) FROM DBA_TABLES;
    you should then add an 10-20% to the result due to the definitions in the export file.
    Source:Paul M. @ Re: estimating size of a .dmp file
    HTH
    Girish Sharma

  • How to keep the old jdbc log file

    Hi,
    whenever I restart the wls8.1, the jdbc logs are rewritten. I could not find my
    previous log to debug anymore, how can i config to make write to a new file like
    wls log. Thanks

    Hi Jen!
    This is bug in 8.1ga and sp1 and it is fixed ib 81sp2.
    When you specify jdbc log name with ".log" suffix, jdbc logging doesn't
    rotate as expected. So, the prior log file would be overwrited by new jdbc
    log when you restart WLS.
    Workaround
    Remove ".log" from the file name. It would be added by WLS automatically.
    Thanks,
    Mitesh
    Jen wrote:
    Hi,
    whenever I restart the wls8.1, the jdbc logs are rewritten. I could not find my
    previous log to debug anymore, how can i config to make write to a new file like
    wls log. Thanks

  • How to delete the standby archive log files in ASM?

    Hi Experts
    we have a realtime downstream replication that is using the a location in ASM to put the shipped logs files.
    set up by
    ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='LOCATION=+BOBOASM/NANPUT/standbyarchs/
    VALID_FOR=(STANDBY_LOGFILE,PRIMARY_ROLE)' Scope=BOTH;
    What shall i do to clean up those files ?
    Any procedure or script to do that?
    Thanks

    Hello Haggylein
    check this out, seems to work
    --- redologs used or not?
    ---- when purgeable we can delete it
    COLUMN CONSUMER_NAME HEADING 'Capture|Process|Name' FORMAT A15
    COLUMN NAME HEADING 'Archived Redo Log|File Name' FORMAT A25
    COLUMN FIRST_SCN HEADING 'First SCN' FORMAT 99999999999
    COLUMN NEXT_SCN HEADING 'Next SCN' FORMAT 99999999999
    COLUMN PURGEABLE HEADING 'Purgeable?' FORMAT A10
    SELECT r.CONSUMER_NAME,
    r.NAME,
    r.FIRST_SCN,
    r.NEXT_SCN,
    r.PURGEABLE
    FROM DBA_REGISTERED_ARCHIVED_LOG r, DBA_CAPTURE c
    WHERE r.CONSUMER_NAME = c.CAPTURE_NAME and PURGEABLE = 'YES';
    -- Now the script
    -- to be executed on the downstream database
    -- generate the list of logs to be purged and executed in a ksh script
    -- sqlplus "/as sysdba" @$HOME/bin/generate_list.sql
    SET NEWPAGE 0
    SET SPACE 0
    SET LINESIZE 150
    SET PAGESIZE 0
    SET TERMOUT OFF
    SET ECHO OFF
    SET FEEDBACK OFF
    SET HEADING OFF
    SET MARKUP HTML OFF SPOOL OFF
    spool list_purgeable_arch_redologs.ksh
    SELECT 'asmcmd ls ' || r.NAME
    FROM DBA_REGISTERED_ARCHIVED_LOG r, DBA_CAPTURE c
    WHERE r.CONSUMER_NAME = c.CAPTURE_NAME and PURGEABLE = 'YES';
    spool off
    exit
    # eventually we can call it from a script
    # !ksh
    # delete of the shipped redologs
    # to be performed on node 2
    # not to be used on
    $HOME/bin/export ORACLE_SID=+ASM2
    ./list_purgeable_arch_redologs.ksh
    exit

  • How to get the size of uploaded file in sap ABAP MODULE POOL PROGRAMMING

    Hello,
    I am using a fucntion module GUI UPLOAD to upload a file from pc to SAP .
    I want to upload the details of the file.
    i.e TYPE NAME AND SIZE of the file.
    I am unable to do so.
    Help me.
    Gaur Mayank

    Perhaps you could count this by yourself...
    You could approach the correct size by calculating the number of bytes contained in each rows of your table.
    For this you will first need to upload the file to a table of string, so that each field separator is counted.
    something like:
    DATA: lt_data TYPE STANDARD TABLE OF string,
          l_len TYPE i.
    FIELD-SYMBOLS <data> TYPE string.
    "... gui_upload to lt_data              
    DESCRIBE TABLE lt_data LINES l_len.
    l_len = ( l_len - 1 ) * 2.        "Count 2 bytes at end of each line for CRLF
    LOOP AT lt_data ASSIGNING <data>. "Add length of each line
        l_len = l_len + strlen( <data> ).
    ENDLOOP.
    WRITE: l_len.
    This for a single-byte codepage of course... you can use charlen in order to have the length of one char on your system, here I'm asuming it is 1.
    Kr,
    Manu.

  • How to get the size of a file that will be uploaded by download component

    hi i want to show some extra information with download component like size of file how can i do it ?? is anybody having any idea??

    Hi karansheel,
      Use getData().getLength() not working ?
    http://forums.adobe.com/message/4759683
    Thanks,
    Sham
    @adobe_sham

  • How to reduce the size of EAR file

    Hi,
    In our project we are getting EAR of size 60MB .
    While checking over that i have noticed there are 45 MB of jar files in the lib .
    Is it possible to make the JAR files out side the EAR file and in specified location and refer with class path.
    Please advice

    As Frank suggests,
    1). Deploy those utilities as shared libraries on WebLogic
    2). Edit the weblogic-application.xml to refer to the shared libraries (you'll find weblogic-application.xml in the application navigator, the application resources tab, descriptors->META-INF folder). Use the "libraries" tab in the weblogic-application.xml editor to make it easy.
    3). Check the deployment profiles (Application properties->Deployment->edit and Project properties->Deployment->edit) as well as your library definitions (tools->manage libraries - check for "deploy by default") to ensure that the library JAR files don't get packaged up in the EAR
    John

  • How to query the size of a file?

    as title~
    How can I do?

    Is the return value in bytes?Yep. (Assuming you mean the length of the file in
    bytes: ie 1074 bytes, etc...) If you mean "does it
    return an array of bytes?" ... then no, as in my
    original post, it returns a long.Thanks a lot.

Maybe you are looking for