CODE: Resetting System.out

I think Julia asked about using another srv.log to log some
information.  You can reset System.out to another log file as a
possibility.  This might be nice to keep Jaguar server messages in
srv.log and other logging, like from a PowerJ Query object to a seperate
log file.  You can issue this call in the VM

  System.setOut(new java.io.PrintStream(new java.io.FileOutputStream(
            new java.io.File("debug.log"))));

This will now reset System.out to a log file named debug.log.  Since all
methods on System are static, you only need to do this once.  You could
write a simple service component which does this, and then stops, such
as


/**
* Resets system.out and then stops.
*
*/

public class LogRedirect
{
    private boolean _start = false;

    public void start()
    {
        _start = true;
    }

    public void run()
    {
    System.setOut(new java.io.PrintStream( new java.io.FileOutputStream(

        new java.io.File("debug.log"))));
    stop();
    }

    public void stop()
    {
        _start = false;
    }
}

If you want messages to get to srv.log, you should use
Jaguar.writeLog().

Dave Wolf
EAServer Product Team

0
David
12/1/1998 5:18:09 PM
sybase.easerver 11371 articles. 0 followers. Follow

1 Replies
905 Views

Similar Articles

[PageSpeed] 24
Get it on Google Play
Get it on Apple App Store

There are now some parts of Jaguar that write information
to System.out, on the assumption that it is going to srv.log.
So anyone trying this beware you may get Jaguar system
messages (most likely from the Repository) in your log.

Another option is to use:

class MyLog
{
     static java.io.OutputStream log = new FileOutputStream(...);
}

Then whenever you want to write to your log use MyLog.log.println(...)

David Wolf wrote:

> I think Julia asked about using another srv.log to log some
> information.  You can reset System.out to another log file as a
> possibility.  This might be nice to keep Jaguar server messages in
> srv.log and other logging, like from a PowerJ Query object to a seperate
> log file.  You can issue this call in the VM
>
>   System.setOut(new java.io.PrintStream(new java.io.FileOutputStream(
>             new java.io.File("debug.log"))));
>
> This will now reset System.out to a log file named debug.log.  Since all
> methods on System are static, you only need to do this once.  You could
> write a simple service component which does this, and then stops, such
> as
>
> /**
> * Resets system.out and then stops.
> *
> */
>
> public class LogRedirect
> {
>     private boolean _start = false;
>
>     public void start()
>     {
>         _start = true;
>     }
>
>     public void run()
>     {
>     System.setOut(new java.io.PrintStream( new java.io.FileOutputStream(
>
>         new java.io.File("debug.log"))));
>     stop();
>     }
>
>     public void stop()
>     {
>         _start = false;
>     }
> }
>
> If you want messages to get to srv.log, you should use
> Jaguar.writeLog().
>
> Dave Wolf
> EAServer Product Team

0
Evan
12/1/1998 5:38:21 PM
Reply:

Similar Artilces:

I store my all business code in the system folder "App_Code" , is the folder "App_Code" protected by system? can't nobody see source code in the folder?
In ASP.NET 2.0, I store my all business code in the system folder "App_Code" , is the folder "App_Code"  protected by system? can't nobody see source code in the folder?  SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip filesSuperCool Random Number Generator Hi, it cannot be downloaded by users of the web application, but certainly administrator of the server etc could just check what the file contains. E.g they, class files, are normal files from that standpoint. That is, if you just deploy them to the server as is, into production. &...

To code or not to code?
The rise of Open Source software adoption has brought with it increased awareness of non-proprietary programming technologies. http://www.itnews.com.au/Feature/4593,to-code-or-not-to-code.aspx -- "Never drive faster than your ANGEL can fly" ...

Need advice on changing some data adapter code from System.Data.SqlClient to System.Data.ODBCClient
I have the following code I built to work with a SQL Server database and it works but I need to convert it so that it uses ODBC connections....Can anyone please help me?????  Please  SQLClient Code Imports System.Data.SqlClientPublic Class OrderDB    Public Shared Function GetQueryObject1(ByVal Company As String, ByVal txtPONum As Integer, ByVal txtPOLine As Integer) As PartTranQuery 'Returning the QueryObject used in the Order.aspx code behind         Dim sSelect As String = "SELECT InvoiceNum,InvoiceLine,VendorNum,PurPoint,PartD...

Problem Specifying a file path (Operating system error code 3(The system cannot find the path specified.). )
Hi Iam Raviteja new to ASP and SQL server working with a project that uses asp.net as front end that bulk loads the table in SQL server with data from a text file. I pass the path of the uploaded file as a paramter to the stored procedure in the SQL server. The database is on a server called astra and the text file is on a machine that I work from. When I try to execute the procedure I get an error as  Error:Could not bulk insert because file 'C:\Documents and Settings\vchilakamarthi\My Documents\Visual Studio 2005\WebSites\WebSite1\\load_utt_misc_rooms.txt' could not be open...

superreview requested: [Bug 297086] Enable xpcom c++ code to reset the slow script counter : [Attachment 185681] provide a function for resetting the slow script counter
timeless@myrealbox.com (working) <timeless@bemail.org> has asked Johnny Stenback <jst@mozilla.org> for superreview: Bug 297086: Enable xpcom c++ code to reset the slow script counter https://bugzilla.mozilla.org/show_bug.cgi?id=297086 Attachment 185681: provide a function for resetting the slow script counter https://bugzilla.mozilla.org/attachment.cgi?id=185681&action=edit ...

deploy error:Deployment Error Deploying PBDs To Host Repository Location 'n_cst_fhbp0400' EAServer error code: SystemException: CORBA::COMM_FAILURE, exception code: 7
Sir, I deployed my PB components to EAServer 4.2.3.There are over 500 pbl files which would be deployed to EAServer. Most of them were deployed well.But there were some error about last 10 deployed pbl files. The error message like : Deployment Error Deploying PBDs To Host Repository Location 'n_cst_xxxxxx' EAServer error code: SystemException: CORBA::COMM_FAILURE, exception code: 7 I ued command line to deploy my application. Ex: c:\pb80 /workspace d:\cdshop\cdshop.pbw /deploy /output d:\tmp\cdshop.out I think OS socket numbers are not enough. ...

Custom tool error: "Code generator 'ReportCodeGenerator' failed. Exception stack = System.Exception: Load report failed. ---> System.Runtime.InteropServices.COMException (0x800001FD):
The tool which generates the class file for the crystal report files throws this error for a particular report. this is the error C:\MRPS\MRPSWEB\Reports\AuditForm.rpt(1): Custom tool error: "Code generator 'ReportCodeGenerator' failed.  Exception stack = System.Exception: Load report failed. ---> System.Runtime.InteropServices.COMException (0x800001FD): Invalid field name.   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(...

EAServer Error Code
I have a PB NVO JAG component that does dw retrieves. When I implement in a PB client app, I get an error code 20518. What could this be? Thanks nick Is there any errors in the srv.log? -- Dean Jones TeamSybase PowerTeam, Inc. www.powerobjects.com "Nick N." <nicksan@worldnet.att.net> wrote in message news:W32evQ1IAHA.70@forums.sybase.com... > I have a PB NVO JAG component that does dw retrieves. > > When I implement in a PB client app, I get an error code 20518. What could > this be? > > Thanks > nick > > <!...

Code for System procedures
Can anyone tell me where I can find code for system procedure. I am unable to find sp_helpconstraint in my master database stored procedures folder though I have few system procedures there. Thanks Paresh -- Posted via http://dbforums.com 1> use sybsystemprocs 2> go 1> sp_helptext sp_helpconstraint 2> go Regards, Mark "pareshv" <member28264@dbforums.com> wrote in message news:2776137.1050534809@dbforums.com... Can anyone tell me where I can find code for system procedure. I am unable to find sp_helpconstraint in my master database stored ...

Resetting EAServer nightly
Is there a setting in EA Server to have it reset or refresh itself every night? If so, how is it set? Mike; Not in the current releases ... however, have a look at my EAS Monitor application on CodeXchange. It can do that for you as well as recycle EAS when the JVM becomes unstable. Note: You could also implement that functionality using a "JagTool.bat" using a O/S scheduler task as well. Regards ... Chris "Mike" <michaeldtirrell@yahoo.com> wrote in message news:446891e3$1@forums-2-dub... > Is there a setting in EA Server to have it...

Operating system for EAServer
Sybase EAServer 4.1 now is the best product on the market to put PowerBuilder Applications on the Web. EAServer version 4.1, build 41025 now is compatible with the following platforms and operating system configurations: - Microsoft Windows NT 4.0; - Microsoft Windows 2000. Our company currently using Microsoft Windows 98 and discussing now to move either to Windows 2000 or Windows XP. Is it possible to have later EAServer version built for Windows XP or we need to stay with Windows 2000 to have possibility to work with EAServer ? ---== Posted via the PFCGuide Web Newsreader ==-...

System Folder Reset
I have a user at one client who can no longer see the Trash folder in his client. I had him check in the cabinet to make sue it didn;t get drag and dropped accidentally. I thought the new system folders were not supposed to be able to be deleted. I did try the Mailbox/Library maintenance with the musc switch FOLDERRESET but that did not work. any suggestions... thanks -- Paul Lamontagne Lamtech Consulting Inc. Paul.Lamontagne@nocni-mctspam.com --____XXBEBLODVZJSQHKYPSUK____ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 Content-Di...

Resetting error code?
We're migrating a system from OraPerl to DBI and DBD::Oracle, and we want to have certain error codes be ignored. Currently this is done in OraPerl by resetting the $ora_errno variable to 0, but this isn't allowed in DBI since it's a tied variable. I've worked out a few possible approaches to this problem, and wanted to find out which is the best one by asking the experts (that means you). 1. use tied($DBI::err) to get at the to the actual variable 2. Modify $DBD::Oracle::err instead 3. Call DBI::set_err 4. Call DBI::event Which of these is best, or is there...

Cookie System Code Update
Gang... We're nearly there. All page asset types are now deeply supported, and the Cookie Context tracking is now in place and working correctly... ---------------------------------------------------------------- I HAVE CHANGED THE NAME OF SOME COOKIES, SO YOU **MUST** DELETE ALL OLD GRC and GRCTECH COOKIES -(OR ALL COOKIES)- IN ORDER TO GET NEW RESULTS! ---------------------------------------------------------------- The only thing not yet present is the inclusion of a third-party iFrame. I'll get that nailed tomorrow. It's still distressing. And you&#...

Web resources about - CODE: Resetting System.out - sybase.easerver

Speaker of the House John Boehner on resetting America’s economic foundation - YouTube
Speaker John Boehner (R-OH) delivers his five-point policy vision to reset America’s economy. He discusses how the emerging energy boom in the ...

Neuroscience suggests resetting the clock on 'coming of age'
New techniques for tracking brain growth show radical change extends into at least the mid-20s.

University deregulation: Top-tier institutions call for end to political process, resetting of debate ...
Australia's leading research universities call for a depoliticised process to reset the higher education debate.

Cycle of Life: Resetting L.A.'s Smoking Deaths Billboard
Ushering in the New Year at the Smoking Deaths billboard above Santa Monica Boulevard in West L.A. has become a somewhat morbid yet surprisingly ...

Resetting the net: Snowden and surveillance
One year after Edward Snowden exposed the spying at the NSA, can the internet be re-set?

Resetting Uncle Sam’s Clocks
Allison Schrager wants the US to simplify its time zones: This year, Americans on Eastern Standard Time should set their clocks back one hour ...

Don't Change Your Google Password Before Factory Resetting Your Android Phone - You Might Trip A 72-Hour ...
This isn't a news story, but more of a "public service announcement" about an Android feature not everyone may be aware of. If you've ended up ...

Resetting your DNS cache
Ever find yourself in a situation where a web site is loading on one device and not another? Or, perhaps, you just registered a new domain name ...

Resetting the Astros' roster
Resetting the Astros' roster

Resetting the Philadelphia Eagles' Draft Board
The Philadelphia Eagles have been—and might very well continue to be—very busy in free agency. As a result, their draft board is constantly evolving... ...

Resources last updated: 12/19/2015 2:56:10 PM