How to redirect the tomcat (5.0) console output to a text file

Hello,
I am looking for a way of redirecting the tomcat console output [the System.out.println("xyzabc")�s from the java classes running on the container] to a text file.
The reason is that the programmers need to have that console�s output and the server (windows) have to be rebooted often (no wonder: windows) and then Tomcat start as a service -> console is not visible.
Thanks!

The console out put should still be in the log files if tomcat is running as a windows service. It will either be in logs\stdout_xxxx.log and logs\stderr_xxxx.log or in logs\catalina.xxxx.log.
If you are using 5.5.
It will either be in logs\stdout.log and logs\stderr.log or in logs\catalina.out.
if you are using 5.0

Similar Messages

  • How to get the source code of an HTML page in Text file Through J2EE

    How to get the source code of an HTML page in Text file Through J2EE?

    Huh? If you want something like your browser's "view source" command, simply use a URLConnection and read in the data from the URL in question. If the HTML page is instead locally on your machine, use a FileInputStream. There's no magic invovled either way.
    - Saish

  • How to get the source code of an HTML page in Text file Through java?

    How to get the source code of an HTML page in Text file Through java?
    I am coding an application.one module of that application is given below:
    The first part of the application is to connect our application to the existing HTML form.
    This module would make a connection with the HTML page. The HTML page contains the coding for the Form with various elements. The form may be a simple form with one or two fields or a complex one like the form for registering for a new Bank Account or new email account.
    The module will first connect through the HTML page and will fetch the HTML code into a Text File so that the code can be further processed.
    Could any body provide coding hint for that

    You're welcome. How about awarding them duke stars?
    edit: cheers!

  • How to redirect the tomcat to my project folder!

    instead of putting all the files inside of the <tomcat>/webapps/<myfolder>
    I try to move the <myfolder> to another directory.
    say, /home/<myname>/<myfolder>
    so that, i can work in my home directory by /<hostname>:<port>/<myfolder>
    what procedures i should take ?

    In the server.xml file:
    <!-- Tomcat myApp Context -->
    <Context path="/Kiosk" docBase="c:\myApp" reloadable="true" debug="0">
    </Context>
    Not sure about the format of the docBase string.

  • Report the size of all SharePoint Databases in a text file using PowerShell?

    I am new to Powershell. please help me for following question with step by step process.
    How to report the size of all SharePoint Databases in a text file using PowerShell?

    Hi Paul,
    Here is the changed script, which will also include the size for the Config DB.
    Please let me know if it worked:
    #Get SharePoint Content database sizes
    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
    $date = Get-Date -Format "dd-MM-yyyy"
    #Variables that you can change to fit your environment
    $TXTFile = "D:\Reports\SPContentDatabase_$date.txt"
    $SMTPServer = "yourmailserver"
    $emailFrom = "[email protected]"
    $emailTo = "[email protected]"
    $subject = "Content & Config Database size reports"
    $emailBody = "Daily/Weekly/Monthly report on Content & Config databases"
    $webapps = Get-SPWebApplication
    $configDB = Get-SPDatabase | ?{$_.Name -eq ((Get-SPFarm).Name)}
    $ConfigDBSize = [Math]::Round(($configDB.disksizerequired/1GB),2)
    Add-Content -Path $TXTFile -Value "Config Database size: $($ConfigDBSize)GB"
    Add-Content -Path $TXTFile -Value ""
    foreach($webapp in $webapps)
    $ContentDatabases = $webapp.ContentDatabases
    Add-Content -Path $TXTFile -Value "Content databases for $($webapp.url)"
    foreach($ContentDatabase in $ContentDatabases)
    $ContentDatabaseSize = [Math]::Round(($ContentDatabase.disksizerequired/1GB),2)
    Add-Content -Path $TXTFile -Value "- $($ContentDatabase.Name): $($ContentDatabaseSize)GB"
    if(!($SMTPServer) -OR !($emailFrom) -OR !($emailTo))
    Write-Host "No e-mail being sent, if you do want to send an e-mail, please enter the values for the following variables: $SMTPServer, $emailFrom and $emailTo."
    else
    Send-MailMessage -SmtpServer $SMTPServer -From $emailFrom -To $emailTo -Subject $subject -Body $emailBody -Attachment $TXTFile
    Nico Martens - MCTS, MCITP
    SharePoint 2010 Infrastructure Consultant / Trainer

  • How to View the Scheduler in ODI Console

    Hi
    In ODI Studio, we may Schedule a Scenario and also, we may view all Schedules process from the Agents (View Schedule option).
    My colleagues are going to use ODI Console, but we cannot find out HOW to View the Schedule in ODI Console.
    In Oracle documentation about FDMEE, we can read the following: If you want to cancel a specific instance of a schedule, use the ODI Studio or ODI Console... see the PDF document in attachment.
    Regards
    Claude

    To display the schedule for one agent:
    In Topology Navigator expand the Agents node in the Physical Architecture accordion.
    Select the Physical Agent you want to update the schedule.
    Right-click and select View Schedule.
    The Schedule Editor appears, displaying the schedule for this agent.
    Check: http://docs.oracle.com/cd/E17904_01/integrate.1111/e12643/running_executions.htm#ODIDG634
    HTH -
    Jasmine

  • How to store the data coming from network analyser into a text or excel file

    Hii everyone
    I'm using Agilent 8719ET network analyser and wish to store the data coming from netowrk analyser into a text file/ excel file.
    Presently I'm able to get the data on Labview graph using GPIB . Can anyone suggest how to go ahead after collect data sub vi. How can the data be stored into a file apart from showing on the graph?
    Attached is the vi for kind consideration...
    Looking for help
    Regards
    Rohit
    Attachments:
    Agilent 87XX Series Exceed Max Meas.vi ‏43 KB

    First let me say that your code really looks pretty good. The data handling could be made more efficient by calculating the number of datapoints that are going to be in the completed dataset and preallocating the entire array -- but depending upon your answer to my questions, the logic in the lower shift register may be going away - so we won't worry about that right now.
    The thing I need to know before addressing the data storage question is: Each time you call "Collect and Display Data.vi", how many element are in the array? Are you reading single data points, or a group of data? (BTW: if the answer to that question is obvious based on the way the other VIs are setup, I don't have the drivers so I can't tell what the setup values are.) Second, how fast does the loop iterate? Are we talking msec per loop?, seconds? fortnights?
    The issues here are two-fold: how much data? and how fast is it coming? The answer to these will tell you how to save the data.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to move the data of a table from sqlplus to XML file

    Hi,
    Could you pls guide me how to move the data of a table from sqlplus to XML file.
    i want to do it from sqlplus rather than toad.pls help
    Thanks

    Oh..I'm in 9i.
    Try this out..and let me know.
    DECLARE
    CTX DBMS_XMLGEN.CTXHANDLE ;
    XML CLOB ;
    F UTL_FILE.FILE_TYPE;
    XMLC VARCHAR2(32767);
    BEGIN
    CTX := DBMS_XMLGEN.NEWCONTEXT('SELECT * FROM department1 ') ;
    XML := DBMS_XMLGEN.GETXML(CTX) ;
    XMLC:=TO_CHAR(XML);
    SHOW_ENVELOPE(XMLC);
    F := UTL_FILE.FOPEN('ATTACH_FILES','DEPT.XML', 'W');
    UTL_FILE.PUT_LINE(F,XML);
    UTL_FILE.FCLOSE(F);
    END ;
    Good luck!!!
    Bhagat
    null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to customize the Java Concurrent Program(PO Output for Communication)

    Hi,
    How to customize the Java Concurrent Program(PO Output for Communication)
    I need to add the Line level Ship To Address ,Line Notes and Extended Price fields on Java Concurrent Program.
    Please any body help/guide me in this regard.

    Hi,
    Changing Java Conc. program for "PO Output for Communication" is difficult.
    Actually, if you observe closely, "PO Output for Communication" program uses PO<HEADER/LINES..>_XML views.
    So if you could change these views and add your requireed columns to it, you can automatically see your changes in XML data file.
    See if the following link will you to get there.. http://chandramatta.blogspot.com/
    thanks,
    Matt

  • How to get the path when i select a directory or a file in a JTree

    How to get the path when i select a directory or a file in a JTree

    import java.lang.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.HeadlessException;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Iterator;
    * @author Frederic FOURGEOT
    * @version 1.0
    public class JTreeFolder extends JPanel {
    protected DefaultMutableTreeNode racine;
    JTree tree;
    protected JScrollPane scrollpane;
    final static int MAX_LEVEL = 1; // niveau max de descente "direct" dans l'arborescence
    * Sous-classe FSNode
    * @author Frederic FOURGEOT
    * @version 1.0
    private class FSNode extends DefaultMutableTreeNode {
    File file; // contient le fichier li� au noeud
    * Constructeur non visible
    private FSNode() {
    super();
    * Constructeur par initialisation
    * @param userObject Object
    FSNode(Object userObject) {
    super(userObject);
    * Constructeur par initialisation
    * @param userObject Object
    * @param newFile File
    FSNode(Object userObject, File newFile) {
    super(userObject);
    file = newFile;
    * Definit le fichier lie au noeud
    * @param newFile File
    public void setFile(File newFile) {
    file = newFile;
    * Renvoi le fichier lie au noeud
    * @return File
    public File getFile() {
    return file;
    public JTree getJTree(){
         return tree ;
    * Constructeur
    * @throws HeadlessException
    public JTreeFolder() throws HeadlessException {
    File[] drive;
    tree = new JTree();
    // cr�ation du noeud sup�rieur
    racine = new DefaultMutableTreeNode("Poste de travail");
    // cr�ation d'un noeud pour chaque lecteur
    drive = File.listRoots();
    for (int i = 0 ; i < drive.length ; i++) {
    FSNode node = new FSNode(drive, drive[i]);
    addFolder(drive[i], node); // on descend dans l'arborescence du lecteur jusqu'� MAX_LEVEL
    racine.add(node);
    // Gestion d'evenement sur JTree (on �coute les evenements TreeExpansion)
    tree.addTreeExpansionListener(new TreeExpansionListener() {
    public void treeExpanded(TreeExpansionEvent e) {
    // lorsqu'un noeud est ouvert
    // on descend dans l'arborescence du noeud jusqu'� MAX_LEVEL
    TreePath path = e.getPath();
    FSNode node = (FSNode)path.getLastPathComponent();
    addFolder(node);
    ((DefaultTreeModel)tree.getModel()).reload(node); // on recharche uniquement le noeud
    public void treeCollapsed(TreeExpansionEvent e) {
    // lorsqu'un noeud est referm�
    //RIEN
    // alimentation du JTree
    DefaultTreeModel model = new DefaultTreeModel(racine);
    tree.setModel(model);
         setLayout(null);
    // ajout du JTree au formulaire
    tree.setBounds(0, 0, 240, 290);
    scrollpane = new JScrollPane(tree);
         add(scrollpane);
         scrollpane.setBounds(0, 0, 240, 290);
    * Recuperation des sous-elements d'un repertoire
    * @param driveOrDir
    * @param node
    public void addFolder(File driveOrDir, DefaultMutableTreeNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    addFolder(driveOrDir, node, 0);
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Recuperation des sous-elements d'un repertoire
    * (avec niveau pour r�cursivit� et arr�t sur MAX_LEVEL)
    * @param driveOrDir File
    * @param node DefaultMutableTreeNode
    * @param level int
    private void addFolder(File driveOrDir, DefaultMutableTreeNode node, int level) {
    File[] fileList;
    fileList = driveOrDir.listFiles();
    if (fileList != null) {
    sortFiles(fileList); // on tri les elements
    // on ne cherche pas plus loin que le niveau maximal d�finit
    if (level > MAX_LEVEL - 1) {return;}
    // pour chaque �l�ment
    try {
    for (int i = 0; i < fileList.length; i++) {
    // en fonction du type d'�l�ment
    if (fileList[i].isDirectory()) {
    // si c'est un r�pertoire on cr�� un nouveau noeud
    FSNode dir = new FSNode(fileList[i].getName(), fileList[i]);
    node.add(dir);
    // on recherche les �l�ments (r�cursivit�)
    addFolder(fileList[i], dir, ++level);
    if (fileList[i].isFile()) {
    // si c'est un fichier on ajoute l'�l�ment au noeud
    node.add(new FSNode(fileList[i].getName(), fileList[i]));
    catch (NullPointerException e) {
    // rien
    * Recuperation des sous-elements d'un noeud
    * @param node
    public void addFolder(FSNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    for (int i = 0 ; i < node.getChildCount() ; i++) {
    addFolder(((FSNode)node.getChildAt(i)).getFile(), (FSNode)node.getChildAt(i));
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Tri une liste de fichier
    * @param listFile
    public void sortFiles(File[] listFile) {
    triRapide(listFile, 0, listFile.length - 1);
    * QuickSort : Partition
    * @param listFile
    * @param deb
    * @param fin
    * @return
    private int partition(File[] listFile, int deb, int fin) {
    int compt = deb;
    File pivot = listFile[deb];
    int i = deb - 1;
    int j = fin + 1;
    while (true) {
    do {
    j--;
    } while (listFile[j].getName().compareToIgnoreCase(pivot.getName()) > 0);
    do {
    i++;
    } while (listFile[i].getName().compareToIgnoreCase(pivot.getName()) < 0);
    if (i < j) {
    echanger(listFile, i, j);
    } else {
    return j;
    * Tri rapide : quick sort
    * @param listFile
    * @param deb
    * @param fin
    private void triRapide(File[] listFile, int deb, int fin) {
    if (deb < fin) {
    int positionPivot = partition(listFile, deb, fin);
    triRapide(listFile, deb, positionPivot);
    triRapide(listFile, positionPivot + 1, fin);
    * QuickSort : echanger
    * @param listFile
    * @param posa
    * @param posb
    private void echanger(File[] listFile, int posa, int posb) {
    File tmpFile = listFile[posa];
    listFile[posa] = listFile[posb];
    listFile[posb] = tmpFile;

  • How to limit the number of search results returned by oracle text

    Hello All,
    I am running an oracle text search which returned the following error to my java program.
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    #### ORA-29902: Fehler bei der Ausführung von Routine ODCIIndexStart()
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    java.sql.SQLException: ORA-29902: Fehler bei der Ausführung von Routine ODCIIndexStart()
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
    When i looked up the net, one suggestion that was given is to narrow the wildcard query, which i cannot in my search page. Hence I am left with the only alternative of limiting the number of results returned by oracle text search query.
    Please let me know how to limit the number of search results returned by oracle text so that this error can be avoided.
    Thanks in advance
    krk

    Hi,
    If not set explicitly, the default value for WILDCARD_MAXTERMS is 5000. This is set as a wordlist preference. This means that if your wildcard query matches more than 5000 terms the message is returned. Exceeding that would give the user a lot to sift through.
    My suggestion: trap the error and return a meaningful message to the user indicating that the search needs to be refined. Although it is possible to increase the number of terms before hitting maxterms (increase wildcard_maxterms preference value for your wordlist), 5000 records is generally too much for a user to deal with anyway. The search is not a good one since it is not restricting rows adequately. If it happens frequently, get the query log and see the terms that are being searched that generate this message. It may be necessary to add one or more words to a stoplist if they are too generic.
    Example: The word mortgage might be a great search term for a local business directory. It might be a terrible search term for a national directory of mortgage lenders though (since 99% of them have the term in their name). In the case of the national directory, that term would be a candidate for inclusion in the stoplist.
    Also remember that full terms do not need a wildcard. Search for "car %" is not necessary and will give you the error you mentioned. A search for "car" will yield the results you need even if it is only part of a bigger sentence because everything is based on the token. You may already know all of this, but without an example query I figured I'd mention it to be sure.
    As for limiting the results - the best way to do that is to allow the user to limit the results through their query. This will ensure accurate and more meaningful results for them.
    -Ron

  • How can I get Aperture to dump the photo info on RAW images as a text file?

    When I am uploading files to something like dpReview I often want to provide information on the various aspects of the photo. Most of what I want to be show appears in the METADATA tab under photo info. Is there any way to dump this data for each image as a text file either during the export of the RAW to JPEG or otherwise?

    When you export a master you can create an accompanying IPICT4XMP Sidecar File, that contains the IPICT data. It is not plain text file, but you can open it wit a text editor (Xcode, if you have it) and copy the metadata from there.
    To create the the sidecar file set the Metadata selector to "createIPICT4XMP Sidecar File"

  • Read the first word of each line in a text file

    i need to read the first word of each line of a text file.
    i know of line.split() but not actually sure how i would go about using it
    Any help most appreciated
    Many Thanks
    Ben

    Hi thanks for the reply!
    this is what i tried... and it still doesn't get me the first word of each line!
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.io.*;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import java.util.Calendar;
    import java.util.Scanner;
    import java.util.Vector;
    import java.text.SimpleDateFormat;
    import java.net.InetAddress;
    import java.net.UnknownHostException;
    import java.io.BufferedReader;
    public class testing {
         Vector progs=new Vector();
         Vector rand=new Vector();
         String[] tmp = new String [2];
         String str;
         String str2="ewerwer";
         String str3;
         public void programTest()
                   try
                             BufferedReader in = new BufferedReader(new FileReader("progList.log"));
                             while ((str = in.readLine()) != null)
                                  progs.add(str);
                        catch(IOException e)
                             System.out.println("cannot read file");
         //////THE ISSUES IS HERE....I WANT TO GET THE FIRST WORD FROM EACH LINE OF THE FILE!!!     
              try
                             BufferedReader in2 = new BufferedReader(new FileReader("eventLog.log"));
                             while ((str = in2.readLine()) != null)
                                  tmp = str.split(" ");
                                  System.out.println(tmp[0]);
                        catch(IOException e)
                             System.out.println("cannot read file");
    public static void main(String[] args)
                 testing B = new testing();
                 B.programTest();
               //  B.fileToVector();
                 //B.LoginWindow();
               //B.anomDetect();
    }//end class

  • Wirte the content of an internal table into a text file

    Hello Experts,
    how can I wirte the content of an internal table into a text file and putit on my local
    desktop ?
    Regards
    ertas

    Hi,
      You can use the FM GUI_DOWNLOAD for this purpose.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = 'c:\testmmv.txt'
      FILETYPE                        = 'ASC'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
      WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
      SHOW_TRANSFER_STATUS            = ABAP_TRUE
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = LT_STR
      FIELDNAMES                      = 
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    IF SY-SUBRC <> 0.
    Implement suitable error handling here
    ENDIF.
    With regards,
    Vamsi

  • How can I copy records from a Table to a ASCII/ Text file.?

    Hi
    Can you help me with code for copying the records from an oracle table to a Text file,? I like to copy the 1200 records from a 7 field table to a .txt file and print out the out put.
    earliest reply is deeply appreciated.
    regrds
    Saj

    All I would do is, in SQL*Plus, spool your output to a file and change the pagesize to however many lines you want before the next header break.
    For example:
    SET PAGESIZE 79
    SPOOL OUTPUT.TXT
    Would create an output file called OUTPUT.TXT with header rows produced after every 79 rows of data.

Maybe you are looking for