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.

Similar Messages

  • How to configure and view the log file

    Hi all,
    I   want to view the log file generated on the server when an application is deployed to see the trace of an exception.
    But i dont know how to access it.
    Please if anybody can help me.
    Thanx in advance.
    Regards,
    Neetu

    HI,
    You can see the log file from
    Sys admin->support->portal runtime->log viewer
    See the time and date given in the top of each file name,
    in the search field enter u r portal ID and search to find your error.
    search for the latest log file(see the date and time) and search with u r portal id to find the error.
    Message was edited by: Kirupanand Venkatapathi

  • 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 ?

  • (Cisco Historical Reporting / HRC ) All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054

    Hi All,
    I am getting an error message "All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054"  when trying to log into HRC (This user has the reporting capabilities) . I checked the log files this is what i found out 
    The log file stated that there were ongoing connections of HRC with the CCX  (I am sure there isn't any active login to HRC)
    || When you tried to login the following error was being displayed because the maximum number of connections were reached for the server .  We can see that a total number of 5 connections have been configured . ||
    1: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Current number of connections (5) from historical Clients/Scheduler to 'CRA_DATABASE' database exceeded the maximum number of possible connections (5).Check with your administrator about changing this limit on server (wfengine.properties), however this might impact server performance.
    || Below we can see all 5 connections being used up . ||
    2: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:[DB Connections From Clients (count=5)]|[(#1) 'username'='uccxhrc','hostname'='3SK5FS1.ucsfmedicalcenter.org']|[(#2) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#3) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#4) 'username'='uccxhrc','hostname'='PFS-HHXDGX1.ucsfmedicalcenter.org']|[(#5) 'username'='uccxhrc','hostname'='47BMMM1.ucsfmedicalcenter.org']
    || Once the maximum number of connection was reached it threw an error . ||
    3: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Number of max connection to 'CRA_DATABASE' database was reached! Connection could not be established.
    4: 6/20/2014 9:13:49 AM %CHC-LOG_SUBFAC-3-UNK:Database connection to 'CRA_DATABASE' failed due to (All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054.)
    Current exact UCCX Version 9.0.2.11001-24
    Current CUCM Version 8.6.2.23900-10
    Business impact  Not Critical
    Exact error message  All available connections to database server are in use by other client machines. Please try again later and check the log file for error 5054
    What is the OS version of the PC you are running  and is it physical machine or virtual machine that is running the HRC client ..
    OS Version Windows 7 Home Premium  64 bit and it’s a physical machine.
    . The Max DB Connections for Report Client Sessions is set to 5 for each servers (There are two servers). The no of HR Sessions is set to 10.
    I wanted to know if there is a way to find the HRC sessions active now and terminate the one or more or all of that sessions from the server end ? 

    We have had this "PRX5" problem with Exchange 2013 since the RTM version.  We recently applied CU3, and it did not correct the problem.  We have seen this problem on every Exchange 2013 we manage.  They are all installations where all roles
    are installed on the same Windows server, and in our case, they are all Windows virtual machines using Windows 2012 Hyper-V.
    We have tried all the "this fixed it for me" solutions regarding DNS, network cards, host file entries and so forth.  None of those "solutions" made any difference whatsoever.  The occurrence of the temporary error PRX5 seems totally random. 
    About 2 out of 20 incoming mail test by Microsoft Connectivity Analyzer fail with this PRX5 error.
    Most people don't ever notice the issue because remote mail servers retry the connection later.  However, telephone voice mail systems that forward voice message files to email, or other such applications such as your scanner, often don't retry and
    simply fail.  Our phone system actually disables all further attempts to send voice mail to a particular user if the PRX5 error is returned when the email is sent by the phone system.
    Is Microsoft totally oblivious to this problem?
    PRX5 is a serious issue that needs an Exchange team resolution, or at least an acknowledgement that the problem actually does exist and has negative consequences for proper mail flow.
    JSB

  • How to install and verify the license file on ASA 5512-x

    Hi Friends,
    How to install and verify the license file on ASA 5512-x Firewall. I have lincese pak for CX and web security essential.
    What need to be done? can i install this lic file on firewall or need to be install on CX server.  Because i dont have the CX server right now.
    Please share me document for installation of this license.
    thx
    Ashish Kumar

    Hi,
    one possible solution is to use an intermediate array. The intermediate array should be used in the user interface. When new data is entered the VI should read each element and then compare to the elements in the stored array. If all elements are different then update the array, otherwise display a fault message.
    You could use asequence activated when the Enter button is pressed. In the first frame you would compare the First array with the stored array. it is probably best to use a Boolean indicator to show if the data is valid Make sure you declare this as a local variable.
    With the sequence you can perform the comparisons in several seperate frames or in one frame with a OR to link the results. For large numbers of comparisons I prefer to use m
    ultiple frames because otherwise the screen becomes a maze of wires and other programmers who may need to maintain the code in the future will find it hard to follow a single frame.
    Once all the data items have been compared then the following sequence should contain a CASE statement of type True/False. Link a readable copy of your local variable to the selector of this statement. Then in the FALSE case (Assuming you have linked the boolean to be false when no data is duplicated) copy the new array to the stored array. In the TRUE case bring up an error message.
    So long as your arrays are not too large and you do not use this technique in too many places in your code the processor overhead should not be badly affected. For frequent use of such a caomparison in several VIs you may want to create a dedicated subVI for the task. For very large arrays you should seek a different solution.
    Hope that helps a bit.
    Good luck,
    Shaf

  • How do you turn off the log file?

    How can I turn off the log file for WLS? Don't want the added overhead
    of logging during performance tests.
    Edwin

    The only way I know is:
    # startWebLogic.sh > /dev/null &
    Only if you are running on unix.
    Edwin Marcial wrote:
    Ok, I'll settle for this. How do I stop the echo?
    "Larry L. Presswood Jr." wrote:
    you can also have it not echo to the console as well
    Srikant Subramaniam wrote:
    I don't think you can turn off the system log file (weblogic.log). You can
    disable the HTTP specific logging with the following:
    weblogic.httpd.enableLogFile=<boolean>
    (defaults to true)
    Srikant.
    Edwin Marcial wrote:
    How can I turn off the log file for WLS? Don't want the added overhead
    of logging during performance tests.
    Edwin
    Damon Sicore
    [email protected]

  • How to create and see the user interface of helloworld sample??

    hello friends,
    i have deployed the hello world sample
    now i want to know how to create and see the user interface of hello world sample.
    thanks and regards..

    If you go to bpel console host:port/BPELConsole (in a dev install, localhost:9700), click on your process, we will generate, based on the describing wsdl a UI for you ..
    hth clemens

  • How to create and edit a .ini file using java

    Hi All...
    Pls help me in creating and editing an .ini file using java...
    thanks in advance
    Regards,
    sathya

    Let's assume the ini file is a mapping type storage (key=value) so lets use Properties object. (works with java 1.4 & up)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    public class Test {
         private static Properties props;
         public static void main(String[] args) throws IOException {
              File file = new File("test.ini");//This is out ini file
              props = new Properties();//Create the properties object
              read(file);//Read the ini file
              //Once we've populated the Properties object. set/add a property using the setProperty() method.
              props.setProperty("testing", "value");
              write(file);//Write to ini file
         public static void read(File file) throws IOException {
              FileInputStream fis = new FileInputStream(file);//Create a FileInputStream
              props.load(fis);//load the ini to the Properties file
              fis.close();//close
         public static void write(File file) throws IOException {
              FileOutputStream fos = new FileOutputStream(file);//Create a FileOutputStream
              props.store(fos, "");//write the Properties object values to our ini file
              fos.close();//close
    }

  • How to install and start the adapter(FILE)

    hi,
    when i checked in RWB for the  adapters which are INSTALLED and STARTED adapters it's displaying all adapters except FILE adapter .
      I need to known whether this adpater is installed or installed and started ,if the case then how to install and start the adapter

    Hi Nandan,
    if above is the case as i mentioned in previous response then,
    You need to download the latest SAP BASIS 6.40 or 7.0 ".tpz file" (as per you service pack) from service.sap.com. Then you need to put this in the import directory:
    <b>\usr\sap\<your system-id>\SYS\global\xi\repository_server\import\importedFiles</b>
    Now go to
    <b>IR>Tools>Import design Objects, you will find the .tpz file which you down loaded. Import this and refresh your cache.</b>
    P.S This is the exact path in market placehttps://websmp205.sap-ag.de/~form/handler?_APP=00200682500000001943&_EVENT=SEARCH&HIDE=&SEARCH_SPAT=X&SEARCH_BPAT=X&SEARCH_CD=X&SEARCH_P=X&SEARCH_PV=X&SEARCH_C=X&SEARCH_CV=X&SEARCH_TA=&SEARCH_V=&HIDE_EXPERT_SEARCH=X&SEARCH_MAX_RESULT=20
    Regards,
    Sarvesh

  • WLSE how to clear or erase the log files

    Is it possible to clear or erase the log files - ? Without erasing the config ?
    thx

    No, the log files are automatically rotated periodically so that they don't fill up the disk space

  • How to fetch and display arbitrary log files from a managed host?

    We are creating a small management portal for a custom application and need a way to display, in a browser, the contents of an arbitrary log file located on an EM managed host. The effect we are looking for is similar to what you get when you show the contents of a database alert log using EM.
    I want to extend the EM agent to get the log and display the contents, but see two problems: (1) it seems like we would have to schedule the fetch of the log contents to happen on a regular basis and would not be able to do it on demand and (2) storing the results in the EM repository seems like it could consume a pile of storage, even if it only stores the logs for 24 hours.
    I am pretty sure we can bypass the repository somehow because I think the "show database alert log" EM process does so. Of course, I can't really be sure how this code is getting the alert log, but it seems reasonable to assume it is using the management agent.
    Is there some API for the EM Agent that I am missing?
    Any ideas would be appreciated.

    From within OEM it doesnt look possible. User defined metrics (UDM) can only return number or a string. The alertlog fetch is done via alertlogViewer.pl while being passed a couple of parameters.
    OEM does have a preliminary/rough api available at http://www.oracle.com/technology/products/oem/emx/index.html but I havent seen anyone make use of it yet.
    If you use just a web connection then you will probably run into security issues as a web server can usually only view/access stuff under their htmldoc dir.
    Seems like some non-OEM very custom code is what you seek..

  • HT2476 How to create and Manage my files

    I wanted to create a secure folder and maintain the files. How can I do that in the macbook Pro.
    Thanks and regards
    Lakshmi

    You cannot encrypt files and folders w/OS X. Create an encrypted disk image, mount it, and store everything in there. Unmount it when finished. BTW, don't forget the password or the data's toast.

  • How to create and write in a file

    Hello Gurus,
    I am creating a file based on the date and time and writing into that. But, I am still getting exception error and all. Kindly, please let me know.
    thanks for all the help...j
    Error:-
    C:\Usage\JavaFiles>java filename "abc"
    Exception in thread "main" java.io.FileNotFoundException:Detail09-2003-
    03:28:04.doc (The system cannot find the file specified)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
    at TowerDetail.main(TowerDetail.java:30)
    Code sample:-
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.sql.*;
    import java.text.*;
    public class TowerDetail{
    public static void main (String[] args) throws IOException{
    String userName = "user";
    String passwd = "pwd";
    String con_db = "jdbc:odbc:datasource";
    String ssn = args[0];
    Vector results = new Vector();
    Connection con = null;
    CallableStatement cstmt = null;
    java.util.TimeZone tz = java.util.TimeZone.getTimeZone("EST");
    java.util.Date now = new java.util.Date();
    DateFormat df = new SimpleDateFormat("MM-dd-yyyy-hh:mm:ss");
    df.setTimeZone(tz);
    String result = df.format(now);
    String fileName = "Detail"+result+".doc";
    File inputFile = new File(fileName);
    FileOutputStream fos = new FileOutputStream(inputFile);
    PrintWriter pw = new PrintWriter(fos);
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    }catch (Exception e) {
    System.out.println("JDBC Error: "+e.getMessage());
    return;
    try{
    con = DriverManager.getConnection(con_db, userName, passwd);
    cstmt = con.prepareCall("{call dbo.sp_usage_detail(?)}");
    cstmt.setString(1, ssn.trim());
    ResultSet rs = cstmt.executeQuery();
    pw.println("Report "+result);
    pw.println("------------------------------------------------------------------------------------
    while(rs.next()){
    .... write in the file...
    pw.println("------------------------------------------------------------------------------------
    pw.close();
    System.out.println("Your file Detail"+result+".doc is ready!!!");
    cstmt.close();
    con.close();
    }catch(SQLException ex){
    System.out.println("SQLException: ");
    System.out.println(ex.getMessage());
    }catch(NullPointerException e){
    System.out.println("Null Pointer Exception: ");
    System.out.println(e.getMessage());

    Now, I got out of the command prompt and reentered. I didn't set any classpath or anything. I have created a subdir \archive in the C:\ and writing an output file [DetailTower.....doc")into that.
    The DetailTower.class is in C:\Detail\ProjectClass dirctory.
    Now at,
    C:\Detail\ProjectClass\java -classpath . DetailTower "abc"
    I am getting this error:-
    C:\Detail\ProjectClass>java -classpath . DetailTower "999999"
    Exception in thread "main" java.io.FileNotFoundException: c:\archive\DetailTower09-10-2003-06:23:40.doc (The system cannot find the file specified)at java.io.FileOutputStream.open(Native Method)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
            at Detail.main(DetailTower.java:32)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to create and modify an XML file from an Oracle Form

    I would like to build an Oracle Form to maintain a small XML file in the file system (i.e. Not in Oracle database but in the operating system).
    I would like the Form to display existing values from the XML file and the user can update and save content back to the XML file.
    Can any one tell me how this can be done? Thanks.

    Does Forms 9i provide any XML Parser Functions?
    Can I insert the XML file into a table column by inserting XML using the XSU Front End rather than using TEXT_IO to maintain the XML file directly?
    Can I use XSU PL/SQL API in Forms to retrieve and modify XML values?
    Any help is appreciated.

  • How to create and handle a text file in CVI

    Is there any way to create and handle (like...open,write,read,truncate,close)  the .txt file in CVI?

    Sure. CVI is a regular C compiler and hence you can use all ANSI C functions. In addition you can use the File I/O functions from the utility library.

Maybe you are looking for

  • Is it possible to run an iPhone and an iPod off of one iTunes account?

    Is it possible to run an iPhone and an iPod off of one iTunes account?  I want to buy an iPhone but I also want to use my Ipod Touch

  • Various process crashes prevent login to main user account

    Here's a good one. I can't log in to my main user account; here's the recap: Computer was acting slow and pausing a lot over past couple of weeks; I put it down to internet slowness at first, but after awhile I began closing down less-critical proces

  • XML in EJB

    Hello all. I need to use xml file in EJB (there are some properties in it) and i need to store it directly in EJB module. How can I do this?

  • Photoshop Elements 11 crashes whenever I try to make a collage.

    Whenever I try to make a collage using Photoshop Elements 11, the elements program crashes and comes up with a error message stating that it has stopped working (A problem caused the program to stop working correctly.  Windows will close the program

  • Cisco Prime 4.1 Swap Space Issues

    We have a issue where Cisco Prime 4.1 is using alot of swap space. We have 16 Gigs for it and it will use most of it. Also I am running out of Drive Space. I have all of my pruge settings correct, but still having issues. Any ideas? Thanks.