Any ideas creating app to read log file when updated?

Afternoon all,
I have been asked to write a java app which will read the contents of the server log file every time the log file is updated by the server. The app will be deployed onto WebSphere Application Server.
Can anyone point me in the right direction as I have never written anything like this before and I don't know where to start. Any help will be much appreciated.
Thanks in advance,
A.

alex@work wrote:
I agree with most of what you've said but unfortunately I don't have a say in what the company wants. However, I am interested in the appender idea, perhaps they may go for that if I suggest it.I'd say it'll take you a day to read up about Log4J and how to write basic appenders, and another day to write your own appender for this problem. Compare that to the effort of writing something to poll a log file, re-read it constantly and update another file, operations which will get slower and slower as they go along. That's a fair amount more code than a single appender would be. There's how to sell it to your company.
Can you give me a brief overview in how it works?Log4J uses objects called appenders, which take logging info - generated by your container - and do something with it. It ships with some appenders already in it, for writing to stdout, files, sockets and databases. You can also write your own appenders that do something more than these standard ones do. You write logging code in your application - in this case, your container already does this so you don't have to - and the configuration of Log4J decides what happens to these logging messages. That's what you're interested in. You could write an appender - a simple class - that takes raw logging messages in, and writes them out to file in whatever format you want
Come to think of it, depending on how complex the required XML is, you may even be able to do this without writing any code at all. You can write formatting patterns in the Log4J config that existing file appenders will use to write your XML files
A bit of an abstract explanation, I guess. Your best bet is to first ascertain that Log4J is indeed in use, and then read the documentation, which is surprisingly good for an Apache project :-)
[http://logging.apache.org/log4j/1.2/index.html]

Similar Messages

  • APPS 11I:과도한 JVM LOGGING FILE DISCOGROUP.0.STDOUT이 생성됨

    제품 : AOL
    작성날짜 : 2005-10-17
    APPS 11I:과도한 JVM LOGGING FILE DISCOGROUP.0.STDOUT이 생성됨
    ======================================================
    PURPOSE
    Unix Server 에 $IAS_ORACLE_HOME/Apache/Jserv/logs/jvm directory 에 log file 이 과도하게 생성 되었을 경우의 해결책을 제시한다.
    Problem Description
    $IAS_ORACLE_HOME/Apache/Jserv/logs/jvm directory 에 DISCOGROUP.0.STDOUT file size 가 점점 과도하게 증가 하여 resource 를 차지 하게 된다.
    Workaround
    N/A
    Solution Description
    Bug:3132644 에 의한 문제로 아래와 같이 조치 하여야 한다.
    1. Please apply the latest released TXK Autoconfig roll up patch.
    --2005년 10월 가장 최신의 TXK Autoconfig rollup patch는 4104924 이다.
    2. Verify that variable s_jserv_std_log is disabled.
    -- 해당 variable 은 $APPL_TOP/admin/<SID>_<Hostname>.xml (Applications Context File) 에서 확인 할 수 있다.
    Reference Documents
    Note. 275567.1 - Excessive JVM Logging Generated In DiscoGroup.0.stdout With Applications 11i

    Hi;
    Please shutdown all services first, when sometimes pass like 20 min check apps services down or not. Please check alert.log also for any error message
    Also see below links
    runaway processes
    Re: runaway processes
    script issue_urgent
    If possible Please restart server
    Regard
    Helios

  • How to create and manage the log file

    Hi,
    I want to trace and debug the program process.
    I write the code for creating log file and debugging the process.
    But i am not able get the result.
    please help me how to create and manage the log file.
    Here i post sample program
    package Src;
    import java.io.*;
    import org.apache.log4j.*;
    import java.util.logging.FileHandler;
    public class Mylog
         private static final Logger log = Logger.getLogger("Mylog.class");
         public static void main(String[] args) throws Exception {
         try {
           // Create an appending file handler
            boolean append = true;
            FileHandler handler = new FileHandler("debug.log", append);
            // Add to the desired logger
            Logger logger = Logger.getLogger("com.mycompany");
            System.out.println("after creating log file");     
              catch (IOException e)
                   System.out.println("Sys Err");
            }Please give the your valuable suggesstion... !
    Thanks
    MerlinRoshina

    Just i need to write a single line in log file.

  • Is there an app to read PPS files

    is there any app to read pps files ,the app store  shows nothing ,but its search engine is nearly worthless  ,very poor product.
    thanks
    peter

    PowerPoint Viewer for Mac
    One other option not mentioned on that page: OpenOffice.org and its forks.

  • My music files etc were all located on my old laptop which was stolen. I have just plugged my iphone in to my new computer and it has deleted all my files. Has anybody got any ideas on how to retrieve the files?

    My music files etc were all located on my old laptop which was stolen. I have just plugged my iphone in to my new computer and it has deleted all my files. Has anybody got any ideas on how to retrieve the files?

    WINDOWS?
    Connect the iPod to your PC. If iTunes starts syncing (ie erasing) your music automatically, hit the X in the upper right hand corner of iTunes display, to the left of the search box, to stop it.
    In Control Panel, Portable Media Devices, double-click your iPod.
    In the Tools menu -> Options, in the View Tab, check "Show hidden files and folders."
    Navigate to the Music folder. On my 'pod, the full path is
    Portable Media Devices\NAME of IPOD (F:)\iPod_Control\Music
    Select all the music folders, and drag and drop them into a folder on your hard drive, or directly into iTunes.
    And you're done! The iPod music folder structure is strange and inexplicable, but once you move your files into iTunes you can set it to automatically organize your folder by artist and album to clean that up. (To do this, in iTunes Edit menu, choose Preferences and in the Advanced tab, check "Keep iTunes Music Folder organized."
    might be out of date worth a try

  • Any ways to roll over to a different log file when the current log file big

    How to roll over a log file when it reaches maximum to a different log file?
    any ways of doing this??????

    More info in the new owners....
    http://www.oracle.com/technology/pub/articles/hunter_logging.html
    And more!!!!! here to build a configuration file with filehandler properly setted to an specified size
    http://www.linuxtopia.org/online_books/programming_books/thinking_in_java/TIJ317_021.htm

  • I can't open any 60p .mov files in quicktime.  Footage was shot on a JVC GY HM150 which is supposed to record in native fcp format.  Any ideas how I can open these files successfully?

    I can't open any 60p .mov files in quicktime or FCP5.  Sometimes in QT the audio plays but not the video. Footage was shot on a JVC GY HM150 which is supposed to record in native fcp format.  Any ideas how I can open these files successfully?

    Get ClipWrap2 and convert to an editable format for your version of FCP5.
    Probably DVCProHD will work
    x

  • Getting log file when starting J2EE 1.4 Application Server

    I get a log file when starting up the Application Server. I am just a beginner.
    Is there anyone who could help me in setting up?
    Thanks,
    AboliRanade

    What do you mean by you get a log file when starting up the AppServer? There is always a log file present. There should not be a new log file created every time you start the server. Look under <install directory>/domains/domain1/logs for the server log file.

  • Read only files when running in Nokia mode

    I am using a Nokia 6085 running PC Suite in Nokia Mode. I have a problem whereby files saved on the memory card are accessible only as read-only files when opened in their appropriate application. However, in the Nokia browser and when in Data Storage mode they are normal (non-read only) files. This is somewhat annonying.
    Perhaps I hould also add that when I try to save a file tothe memory from an application I am not allowed access to that folder (even though I have administrator functions on).
    Can anyone help me?

    Fairly standard stuff actually.
    I have tried to save both MS Word and Excel files.
    I have noticed that when I try to "browse" to the phone (the Nokia 6085 icon not the phone browser icon) from my Gmail (using Firefox) I receive a message "browsing to this folder has been disabled" and no further explanation.

  • Weblogic 10.1 web apps merge log4j log files into single log file

    Hi
    I have deployed multiple web applications on my weblogic (v 10.1 - JDK 1.5.0_12). I am using log4j-1.2.13.jar in a four different web applications.
    The location for the files are - WEB-INF\lib\log4j-1.3.13.jar and WEB-INF\classes\log4j.properties
    When I deployed all the four webapps in weblogic - we found that all of the apps started writing their logs into the logfile which is configured in the log4j of the first web apps log file. The "first web app" is the web app which is the first app deployed in weblogic.
    I have deployed all the four webapps in Tomcat and found that four separate log files get created. Hence, this problem is unique to Weblogic.
    Any suggestions on what the problem could be? I have been battling with this issue for over a week- and have exhausted all ideas.
    Thank you,
    Ronak S.

    Hi ,
    Read all about your issue here :
    Weblogic 10.0 and Log4j classpath problem
    Issue is that the Weblogic system classloader includes log4J already..
    Use "Filtering ClassLoader" a mechanism to configure deployment descriptors to explicitly specify that certain packages should always be loaded from the application, rather than being loaded by the system classloader.
    see: http://e-docs.bea.com/wls/docs100/programming/classloading.html#wp1097187
    Example:
    Add following to your META-INF/weblogic-application.xml
    <prefer-application-packages>
    <package-name>org.apache.log4j.*</package-name>
    </prefer-application-packages>
    Exclude all library packages used within your applcation to have full control over what is used by the application.
    regards,
    Kris

  • SPAU error reading log file

    Hi All,
    We have an R/3 4.0B landscape and are working on some changes.  I want to see if any SAP delivered objects have been modified in the past, but whenever I run SPAU or SPDD, I get an error message
    "Error Reading File D:\usr\sap\put\log\umodstat.log"  "Message Number 0U 503".
    I can read a text file in the same directory through AL11, so I'm reasonably sure it's not an OS permission problem.
    Any ideas?
    Thanks,
    Alan

    Hi All,
    I had same issue trying to edit sat.trc file, I fixed this problem by manual editing sat.trc file and modified the following line:
    <!FORMATTER[com.sap.tc.logging.perf.PerfFormatter]/>
    change to:
    <!FORMATTER[com.sap.tc.logging.ListFormatter]/>
    after changes you will able to open file with Visaul Admin Log Viewer or standalone logviewer.
    Hope it helps.
    Regards

  • Problem in creating database -Missing Redo log file

    I am try to create a new database using DBCA .While creating a database it shows the error oracle instance terminated.Force Disconnected.
    My alert log file is
    Errors in file /u01/app/oracle/diag/rdbms/oracl/oracl/trace/oracl_ora_5424.trc:
    ORA-00313: open failed for members of log group 1 of thread 1
    ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/oracl/redo01.log'
    ORA-27037: unable to obtain file status
    Linux-x86_64 Error: 2: No such file or directory
    Additional information: 3
    Wed Nov 06 10:07:27 2013
    Errors in file /u01/app/oracle/diag/rdbms/oracl/oracl/trace/oracl_ora_5424.trc:
    ORA-00313: open failed for members of log group 2 of thread 1
    ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/oracl/redo02.log'
    ORA-27037: unable to obtain file status
    Linux-x86_64 Error: 2: No such file or directory
    Additional information: 3
    Errors in file /u01/app/oracle/diag/rdbms/oracl/oracl/trace/oracl_ora_5424.trc:
    ORA-00313: open failed for members of log group 3 of thread 1
    ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/oracl/redo03.log'
    ORA-27037: unable to obtain file status
    Linux-x86_64 Error: 2: No such file or directory
    Additional information: 3
    Wed Nov 06 10:07:38 2013
    Setting recovery target incarnation to 2
    Wed Nov 06 10:07:38 2013
    Assigning activation ID 1876274518 (0x6fd5ad56)
    Thread 1 opened at log sequence 1
      Current log# 1 seq# 1 mem# 0: /u01/app/oracle/oradata/oracl/redo01.log
    Successful open of redo thread 1
    Wed Nov 06 10:07:38 2013
    MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
    Wed Nov 06 10:07:38 2013
    SMON: enabling cache recovery
    Errors in file /u01/app/oracle/diag/rdbms/oracl/oracl/trace/oracl_ora_5424.trc  (incident=1345):
    ORA-00600: internal error code, arguments: [kpotcgah-7], [12534], [ORA-12534: TNS:operation not supported
    Incident details in: /u01/app/oracle/diag/rdbms/oracl/oracl/incident/incdir_1345/oracl_ora_5424_i1345.trc
    Wed Nov 06 10:07:46 2013
    Trace dumping is performing id=[cdmp_20131106100746]
    Errors in file /u01/app/oracle/diag/rdbms/oracl/oracl/trace/oracl_ora_5424.trc:
    ORA-00600: internal error code, arguments: [kpotcgah-7], [12534], [ORA-12534: TNS:operation not supported
    Error 600 happened during db open, shutting down database
    USER (ospid: 5424): terminating the instance due to error 600
    Instance terminated by USER, pid = 5424
    ORA-1092 signalled during: alter database "oracl" open resetlogs...
    ORA-1092 : opiodr aborting process unknown ospid (5424_47935551851664)
    Wed Nov 06 10:07:47 2013
    ORA-1092 : opitsk aborting process
                                                                                                                                   251,1         95%

    >I am try to create a new database using DBCA
    >Please help me to resolve this issue.My redo log file was missing
    DROP and recreate the database.  It is a *new* database without any data.
    Check what datafile locations and redo log file locations you specify when creating the new database. Check if you have permissions and enough disk space.
    Hemant K Chitale

  • IMP: How to Read LOG Files

    Hey Gurus,
       I want to read the log files after executing SE37 t-codes, I tried in sm21 but i didnt get any result.
       Can U tell me how to read the log files ??
       what is T-code for that? or i have change any settings???
      Thanking You,
        Regards
       J Sarathi

    Hi ,
    You can use these two FM for analysing the log ..
                   APPL_LOG_READ_INTERN
                   APPL_LOG_DISPLAY_INTERN
    Or You can create A Zprogram using this FM
    and check the changes using RSDEPEND

  • Is there any downside to writing plain old log files?

    Hi all;
    We have our web & worker roles using log4net to write log files to disk. It works great where we then remote desktop in and go to the folder where they are and we've got exactly what we want - a daily log file for each worker.
    Is there any downside to this approach?
    Also, is there an easy way to have it delete all log files over a month old?
    thanks - dave
    What we did for the last 6 months -
    Made the world's coolest reporting & docgen system even more amazing

    hi dave,
    If you stored the log file on instances disk, you may get them using the RDP. But if you redeployed ,auto-scaled the cloud service, the log file maybe removed. So I don't recommend you storage the content on Azure instances disk.
    If you stored the log file on Azure Blob/Table storage (https://github.com/crossvertise/log4net.Appender.AzureBlobStorage/tree/master/TransactionLogger),
    you could view it using some tool,such as Azure server explore and Azure storage Explore. And Azure storage will backup your storage data well.
    >>Also, is there an easy way to have it delete all log files over a month old?
    If you storage on azure storage, the one approach is that you could remove it manually . Another approach is that you could create a service on your project. And then you could create a Job using Scheduler service (http://msdn.microsoft.com/library/azure/dn479785.aspx
    ).  If you don't like to use the Scheduler service, you could coding a delete log data or file method and execulted  this method every day.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can't install Oracle XE on Windows 7 : the install ends fine but no database created and error in log file

    When i try to install Oracle XE 64bit 11g on a windows 7, the installation ends correctly, but no database is created (no datafiles) and in the log file I find :
    Oracle Database 11g Clusterware Release 11.2.0.2.0 - Production Copyright 1996, 2010 Oracle. All rights reserved.
    2015-03-24 15:24:14.733: [ default][3316]ut_read_reg:2:ocr registry key SOFTWARE\Oracle\olr cannot be opened. error 2
    [ CLSE][3316]clse_get_crs_home: Error retrieving OLR configuration [0] [Error opening olr registry key. Le fichier spécifié est introuvable.
    What's the problem?

    Oracle XE 64bit 11g on a windows 7
    Which edition ?

Maybe you are looking for

  • WebDav error on Windows Server 2008 R2

    I receives following error(pic below) when i try to open "WebDav Authoring Rules" It always happened at the second and more times after IIS Manager reset. At the very first time it opens OK. In addition i did not manage to publish from my streaming d

  • ORA-01693-Max extents reached in lobsegment

    Hi getting this error in our alert log file ORA-01693-Max extents <> reached in lobsegment <name> Can any tell me how to increase (alter) logsegment Thanks Bhanu

  • When trying to download new verions of Firefox, get an error.

    Whenever I try to run an update to Firefox, it downloads it successfully, until this pops up: "The license file for this version could not be found. Please visit the Firefox homepage for more information." I keep hoping that new versions will have fi

  • How long for Raid 5 to rebuild?

    I have a 2ghz g5 xserve with PCI-raid card installed. My raid 5 consists of 3 250ghz drives. The system is not being used at this time because I have a backup server running. My question is how long can I expect this process to take? Its been runnnin

  • Internet problem on university network

    Hello, I have a macbook pro with 10.7.5. And i am connected on internet with ethernet cable on my dormitory. Since 2 days i have a lot of problems with internet : most of the time webpage doesn't open and it is loading. And sometime it work when I un