Log file for sql script
Hi all,
i ran a sql script to create indexes. it finishedits job. Now if I want to have the log of that what should have I added to the script.
(The sql script is nothing but a bunch of create index statements)
Hi,
Use SPOOL.
Eg:
spool c:\test.log
select * from dba_users;
spool offMore info here:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12043.htm#SQPUG125
HTH,
Paulo.
Similar Messages
-
LOG FILE for batch scripting in MAXL
Hello,
I just wanted to know how to create a LOG FILE for batch scripting.
essmsh E:\Batch\Apps\TOG_DET\Scripts\unload_App.msh
copy e:\batch\apps\tog_det\loadfile\gldetail.otl e:\hyperion\analyticservices\app\tog_det\gldetail /Y
essmsh E:\Batch\Apps\TOG_DET\Scripts\Build_Hier_Data.msh
REM
ECHO OFF
ECHO Loading GL actuals into WFS \ Combined......
E:\HYPERION\common\Perl\5.8.3\bin\MSWin32-x86-multi-thread\PERL.EXE E:\Batch\Apps\WFS.COMBINED\AMLOAD\WFSUATAMLOAD.PLX
E:\HYPERION\common\Perl\5.8.3\bin\MSWin32-x86-multi-thread\PERL.EXE E:\Batch\Apps\WFS.COMBINED\AMLOAD\WFSUATAMLOAD.PLX
Drop object d:\NDM\Data\StampFiles\STAMPLOADBKUP.csv of type outline force;
Alter object d:\NDM\Data\StampFiles\STAMPLOAD_cwoo.csv of type outline rename to d:\NDM\Data\StampFiles\STAMPLOADBKUP.CSV;
SET LogFile=E:\Batch\Apps\TOG_DET\Logs.log
This file does not generate log file can any help me what might be the problem? Even though some of the steps above are not correct it should generate me log file atleast. I need syntax or whatever it is to generate Log file.
Regards
SomaI wanted to have a logfile of the following batch script regardless of whether the script is running or not.
essmsh E:\Batch\Apps\TOG_DET\Scripts\unload_App.msh
copy e:\batch\apps\tog_det\loadfile\gldetail.otl e:\hyperion\analyticservices\app\tog_det\gldetail /Y
essmsh E:\Batch\Apps\TOG_DET\Scripts\Build_Hier_Data.msh
REM
ECHO OFF
ECHO Loading GL actuals into WFS \ Combined......
E:\HYPERION\common\Perl\5.8.3\bin\MSWin32-x86-multi-thread\PERL.EXE E:\Batch\Apps\WFS.COMBINED\AMLOAD\WFSUATAMLOAD.PLX
Drop object d:\NDM\Data\StampFiles\STAMPLOADBKUP.csv of type outline force;
Alter object d:\NDM\Data\StampFiles\STAMPLOAD_cwoo.csv of type outline rename to d:\NDM\Data\StampFiles\STAMPLOADBKUP.CSV;
What I really want is I need a log file of the above batch script, how the above scripts are running. I do not care whether they are giving me positive results but I need to know what is happening in logfile. HOw will the log file be generated.
Regards
SOma -
I was running SQL Server 2012 in Win 7 64 bit OS. Some how I found SQLSERVER server is not running and I was not able to run the service. Then I tried to unisntall and install again. And I found that some of the SQL Server
features got failed, like: Reporting Services - Native, Database Engine Services, Data Quality Services, Full-Text and Semantic Extractions for Search and SQL Server Replication. I checked the Summary.txt
file from location C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log. It thsi logs referes to another log file location like:
Feature: Database Engine Services
Status: Failed: see logs for details
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Database Engine Services Instance Features
Component error code: 1639
Component log file: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140127_151409\sql_engine_core_inst_Cpu64_1.log
Error help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=sql_engine_core_inst.msi%400x162A16FE%400x1639
I did unisntall/install multipel times. But fhw to fix the issue that saying in sql_engine_core_inst_Cpu64_1.log file.:
=== Verbose logging started: 1/27/2014 15:45:04 Build type: SHIP UNICODE 5.00.7601.00 Calling process: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\x64\ScenarioEngine.exe ===
MSI (c) (C4:BC) [15:45:04:321]: Resetting cached policy values
MSI (c) (C4:BC) [15:45:04:321]: Machine policy value 'Debug' is 0
MSI (c) (C4:BC) [15:45:04:321]: ******* RunEngine:
******* Product: E:\Software\SQL Full Installation\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi
******* Action:
******* CommandLine: **********
MSI (c) (C4:BC) [15:45:04:322]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (C4:BC) [15:45:04:322]: Grabbed execution mutex.
MSI (c) (C4:BC) [15:45:04:323]: Cloaking enabled.
MSI (c) (C4:BC) [15:45:04:323]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (C4:BC) [15:45:04:323]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (38:8C) [15:45:04:327]: Running installation inside multi-package transaction E:\Software\SQL Full Installation\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi
MSI (s) (38:8C) [15:45:04:327]: Grabbed execution mutex.
MSI (s) (38:A0) [15:45:04:327]: Resetting cached policy values
MSI (s) (38:A0) [15:45:04:327]: Machine policy value 'Debug' is 0
MSI (s) (38:A0) [15:45:04:327]: ******* RunEngine:
******* Product: E:\Software\SQL Full Installation\x64\setup\sql_engine_core_inst_msi\sql_engine_core_inst.msi
******* Action:
******* CommandLine: **********
MSI (s) (38:A0) [15:45:04:452]: Machine policy value 'TransformsSecure' is 0
MSI (s) (38:A0) [15:45:04:452]: User policy value 'TransformsAtSource' is 0
MSI (s) (38:A0) [15:45:04:475]: Machine policy value 'DisableUserInstalls' is 0
MSI (s) (38:A0) [15:45:04:475]: Specified instance {18B2A97C-92C3-4AC7-BE72-F823E0BC895B} via transform :InstID01.mst;:InstName02.mst is already installed. MSINEWINSTANCE requires a new instance that is not installed.
MSI (s) (38:A0) [15:45:04:475]: MainEngineThread is returning 1639
MSI (s) (38:8C) [15:45:04:477]: User policy value 'DisableRollback' is 0
MSI (s) (38:8C) [15:45:04:477]: Machine policy value 'DisableRollback' is 0
MSI (s) (38:8C) [15:45:04:477]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (38:8C) [15:45:04:478]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
MSI (s) (38:8C) [15:45:04:478]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
MSI (s) (38:8C) [15:45:04:478]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (s) (38:8C) [15:45:04:478]: Restoring environment variables
MSI (c) (C4:BC) [15:45:04:481]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (C4:BC) [15:45:04:481]: MainEngineThread is returning 1639
=== Verbose logging stopped: 1/27/2014 15:45:04 ===
Please advice. I searched many places and did not get actual solution that will resolve my case.
Nusrat AkhterHi Nusrat Akhter,
According to your description, when installing the first install failed, and it looks like the instance did not uninstall completely. To solve the issue I recommend you changed the instance name in re-installing SQL Server, and check if it can work fine.
There is a similar issue that the SQL engine will not start, and there is no method of uninstalling either it, or any of the components etc. You can review the following post.
https://connect.microsoft.com/SQLServer/feedback/details/710892/sql-server-2012-rc0-install-fails-citing-invalid-drivers
Thanks,
Sofiya Li
Sofiya Li
TechNet Community Support -
i need two things for my powershell script
1-show successful message if script run successfully
2- if script run with error write error in log file
Please Guide me
$Folders1 = "C:\inetpub\temp\YYY"
cd $Folders1
md $Folders1\Change
Copy-Item * Change -recurse -Force -Exclude Change
md $Folders1\Change\IPC
Move-Item Change\ZZZ Change\ZZZ
xcopy ZZZ Change\IPC\ZZZ /s /i
xcopy OrgFundamental Change\IPC\OrgFundamental /s /i
xcopy Card Change\Card-ib /s /i
$Folders2 = Get-ChildItem $Folders1\Change
foreach($f in $Folders2)
if ($f.name -notlike "IPC" -and $f.name -notlike "CardScheduler" -and $f.name -notlike "Scheduler")
md Change\$f\bin
Move-Item Change\$f\*.dll Change\$f\bin
Get-ChildItem -Path Change\$f "*.exe.config" | Rename-Item -NewName web.configThis is sort of separate from error handling, but when it comes to logging what happens in my scripts, I have two approaches. If the system is running PowerShell 3.0 or later, and I don't care about console output (say, if the script is running as a scheduled
task, and no one will be looking at it interactively anyway), then sometimes I'll run the script like this:
PowerShell.exe -NoProfile -File 'c:\path\to\myScript.ps1' *> 'c:\Logs\someLogFile.txt'
The *> operator (introduced in PowerShell 3.0) redirects the Output, Error, Warning, Verbose and Debug streams, in this case, redirecting them all to a file.
More frequently, though, I use the
PowerShellLogging module. This has a few advantages over the redirection operator:
It works with PowerShell 2.0.
Output can be displayed both on-screen and sent to a log file, with minimal modification to the script code.
You can easily control which streams go to which files in any combination you like.
You can control the content of what gets sent to the log file. When using the stock Enable-LogFile cmdlet, you automatically get date and timestamps prepended to each non-blank line in the file.
Using this module in a script only requires two lines of code (and possibly only one, if you're running PowerShell 3.0 or later with module auto-loading enabled):
Import-Module PowerShellLogging
$logFile = Enable-LogFile -Path 'c:\Logs\someLogFile.txt'
It's also a good idea (but not strictly required) to pass your $logFile object to Disable-LogFile when your script finishes, so no other console output bleeds into your log file before the garbage collector comes along and stops that from happening. -
SSIS 2008 Logging - SSIS Log Provider for SQL Server
Simple SSIS package - copies a table from Server A to Server B.
Everything works except logging using SSIS Log Provider for SQL Server. Selecting the similar events to using
SSIS Log Provider for Text Files does generates a file on the server.
I specified server B on the configuration for SSIS Log Provider for SQL Server.
Logged on with a username with sysadmin rights on Server B. Executed the package using that login and nothing is written to msdb..sysssislog
any ideas what's going on or what am I doing wrong?Just to be sure that the basics are right :
You sure that you configured the log provider correctly?
Selected the required 'components' on the left bar?
Selected events on the Details Tab?
selected the right table? I mean it should be --> select * from msdb..sysssislog
The default schema in your DB setup is dbo right? Coz, if not the logging will be a real problem. You might wanna recreate the table then ..
Btw, if you still experience issues, I'd advise you to enable all events and check for logging just to make sure that there isnt any prob with the DB setup ..
Do try and let us know :)
Edited:
Also a few more:
Check what database you chose in the connection setting page of the logging configuration wizard and check for entries in sysssislog of tht DB as, the sysssislog will be created only in that db.
Ensure that you have execute permission on sp_ssis_addlogentry in that particular db (mostly msdb). Can be checked via:
select name,
has_perms_by_name(name, 'OBJECT', 'EXECUTE') as has_execute
from msdb.sys.procedures
where name like 'sp_ssis_addlogentry' --for 2008 edition and up
or name like 'sp_dts_addlogentry' --for 2005 edition
Thanks to @Sathyanarrayanans for pointing this out :)
Hope this should help ..
Thanks, Jay <If the post was helpful mark as 'Helpful and if the post answered your query, mark as 'Answered'> -
File system log files for SOA Gateway
Hi All,
I need to get log files for my integration repository/SOA Gateway since I'm not able to generate any WSDL or to deploy a web service. In the SOA trouble shoot document, it says:
Log on to Oracle E-Business Suite with the username that has the System Administrator responsibility access privilege.
Select the System Administrator responsibility from the Navigator and choose Oracle Applications Manager > Logs.
Click Log Setup to open the Java System Property Settings page.
Click the Site link and enable log for
Midtier Log File Name: Enter the file name that you would like on the middletier, for example, '/tmp/SOA /tmp/SOALog.log'.
Module=Enter an appropriate module name, for example, 'fnd.soa%'.
Ask your System Administrator to bounce oafm container.
Perform any SOA specific action, such as generate a WSDL file for an PL/SQL API.
Look for logs in the file specified in the Midtier Log File Name field.
My problem is, that my EBS installation is running on windows, so '/tmp/SOA /tmp/SOALog.log' will not work, right? I tried something like /temp/... or c:/temp/... or c:\temp\... but I did not get a logfile called SOALog.log.
What do I have to provide as path here?
Many thanks,
KonradHi!
Did you encounter any error?Yes!
>
try givng C:\temp remember temp should have read and write permissions for the oracle applications o/s user(applmgr)Using c:\temp\test.log results in the following error while saving the log setting:
An error has occurred!
For input string: "10001:\temp\test.log"
I can use whatever string I want, but as long as a ":" is included, I get that error.
As for the user permissions. I installed the EBS using the standard Administrator account and this account is a member of Administrators and ora_dba.
Best,
Konrad -
Sending log files for scheduled jobs as attachment through mail
Hi All,
Can any one please help me out to write a pl/sql program to send log files for scheduled jobs as attachment through mail.
Thanks.Why would anyone do that as this code has already been posted here a thousand times, it is all over the Internet, and the only thing you need to do is to search for it?
I agree it would cost you some effort, but you are getting paid for it, and we are not getting paid for delivering it on a golden plate on your doorstep, as you can not be bothered to use online resources.
Sybrand Bakker
Senior Oracle DBA -
Providing configuration file for SQL 2012 Express installation which installing HPC 2012 R2
Hi guys,
I need to know if there is any way to provide configuration file for SQL 2012 Express installation which installing HPC 2012 R2?
I am scripting installation on HPC 2012 R2 with default SQL 2012 Express edition but I am not able to find any option to provide a configuation file for SQL 2012 Express installaiton.
Thanks,
Vivs.Hi Vivs,
As my understanding, you want to generate a configuration file and install SQL Server 2012 express edition using that configuration file.
If that is the case, firstly, you could generate the configuration file following the steps below since express edition is run in AutoAdvance mode which skips "Ready to Install" page.
1.Double-click SQL Server installation file in your local drive, you will see that the file will be extracted to a temporary folder. Please make a note of what directory it is extracted to. For example, it could be in c:\ followed by a folder name which
will be a set of random letters and numbers "gy7h8hjhhj67rfs7".
2.Cancel installation. Then click on the Start button on the task bar, click run, type the command cmd.exe, and go to that directory via cmd.
3.Execute the following command: setup.exe /ACTION=INSTALL /UIMODE=Normal
4.Follow the wizard through to the 'Ready to Install' page. The path to the configuration file is specified in the 'Ready to Install' page in the configuration file path section.
5.Cancel the setup without actually completing the installation, to generate the INI file.
Secondly, to install SQL Server using Command Prompt, go to the SQL Server installation media root (the temporary folder) from the command prompt and specify the ConfigurationFile.ini as a parameter as shown below.
Setup.exe /ConfigurationFile=ConfigurationFile.INI
For more information about the process, please refer to the article:
http://www.mssqltips.com/sqlservertip/2511/standardize-sql-server-installations-with-configuration-files/
Regards,
Michelle Li -
Hi,
Do we have a log file for DMU? Customer wants to track all the changes the tool makes as part of conversion.
Thanks in advance..
Regards,
SusanYes, the DMU has a log file but its content is not very reliable/legible in release 1.0. The next release should have this fixed. The SQL should be visible on the log level FINEST. The default log location is %APPDATA%\DMU\ on Windows and $HOME/.dmu/ on Unix-like systems.
One place to check what was executed during conversion, though undocumented and thus subject to change at any time, are the repository columns SYSTEM.DUM$SQLTEXT.SQLTEXT (BLOB with the SQL statement) and SYSTEM.DUM$SQLTEXT.SQLCODE (execution error, if any). The column pair [SYSTEM.DUM$SQLTEXT.STEP#, SYSTEM.DUM$SQLTEXT.ORDER#] may be used to sort the statements in the approximate execution order (some statements may be run in parallel so the order is not deterministic).
-- Sergiusz -
The log file for database 'tempdb' is full
Hi Experts,
in my sync RFC to JDBC scenario I get the following error message which says:
11.02.2009 11:23:20 Error Unable to execute statement for table or stored procedure.
'Trns' (Structure 'XYZ')
due to java.sql.SQLException:
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]
The log file for database 'tempdb' is full. Back up the transaction
log for the database to free up some log space.
11.02.2009 11:23:20 Error JDBC message processing failed;
reason Error processing request in sax parser: Error when executing
statement for table/stored proc. 'Trns' (structure 'XYZ'):
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]
The log file for database 'tempdb' is full. Back up the transaction log
for the database to free up some log space.
see here:
http://img23.imageshack.us/img23/6541/unbenannthd9.jpg
does anyone know how to solve this problem?
thanks
chrisChristian,
See this page for more information on the error you're getting: http://sqlserver2000.databases.aspfaq.com/why-is-tempdb-full-and-how-can-i-prevent-this-from-happening.html.
Kind regards,
Koen -
Calling a batch file in sql scripts
Hi friends,
I am looking for a way to call any batch file in sql scripts.I am avoiding to use DBMS_SCHEDULER package because my application server and database server are diifferent .
I am using the sql script in application server.plz help.<ironic>
Ah, I see. This of course explains everything.
</ironic>
Now to be serious: there is no way to run a batch script from SQL. The tools which submit SQL Statements to the database are often capable of doing so; host in SQL*Plus can issue OS commands, the host builtin in Forms does it too, and with dbms_scheduler you can run a shell script on the database server.
So depending on the tools you are using there are several ways to run OS commands. So far you didn't tell us what you want to do with what tools in which version you want to do it. So to only answer is: this is not possible. You cannot run a batch script from plain SQL.
cheers -
Hi all
I've got a error msg when try to generate a report using Cisco history report tool:
Error | An Exceptional Error occurred. Application exiting. Check the log file for error 5022
It only happens when choose report template: ICD_Contact_Service_Queue_Activity_by_CSQ_en_us.
User tried samething on other PC, it working fine.
only on user' own PC and only choose this report, error appears.
user runing windows 7 and do not have crystal report installed
tried reinstalled the software, doesn't work.
also tried this: (https://cisco-support.hosted.jivesoftware.com/thread/2041254) - doesn't work
then tried https://supportforums.cisco.com/docs/DOC-6209 - doesn't work
attached the log file.
thanks.wenqianyu wrote:From the log file:Looks like you get a Login Window.Error message showed up after username/password be enteredThere is an error in the log: Error happened in comparing UCCX version and HRC versionYou may need to do a clean uninstall, download the Historical report from the server, and install it again on the PC.Does this only happen to one PC or to every PC with this application?Wenqian
I have completely uninstalled the HRC, and download from server install again -- still doesn't work with exactly same error.
this matter only happens on this PC, when user try same thing on other PC, it works.
so i think it not relate to server or account. -
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 create different log files for each of web applications deployed in OC4J
Hi All,
I am using OC4J(from Oracle) v1.0.2.2 and Windows2000. Now I want to know
1. how to create different log files for each of my deployed web applications ?
2. what are the advantages in running multiple instances of oc4j and in what case we should run
multiple instances of OC4J ?
3. how to run OC4J as Windows2000 Service rather than Windows2000 Application ?
Thanks and Regards,
Kumar.Hi Avi,
First of all I have given a first reading to log4j and I think there will some more easy way of logging debugging messages than log4j (If you could provide me a detailed explanation of a servlet,jsp,java bean that uses log4j and how to use log4j then it will be very helpful for me). The other easy ways (if I am not using log4j) to my problem i.e creating different log files for each of web applications deployed in oc4j are
I have created multiple instances of OC4J that are configured to run on different ports and so on each instance I have deployed a single web application . And I started the 2 oc4j instances by transferring thier error/log messages to a file. And the other way is ..
I have download from jakarta site a package called servhelper . This servhelper is a thread that is started in a startup servlet and stopped in the destroy method of that startup servlet. So this thread will automatically capture all the system.out.println's and will print those to a file. I believe that this thread program is synchronized. So in this method I need not run multiple instances of OC4J instead each deployed web application on single instance of oc4j uses the same thread program (ofcourse a copy of thread program is put in each of the deployed web applications directories) to log messages on to different log files.
Can you comment on my above 2 approached to logging debugging messages and a compartive explanation to LOG4J and how to use LOG4J using a simple servlet, simple jsp is appreciated ...
Thanks and Regards,
Ravi. -
How to create different log files for different levels
Hi,
Can some one please help me with my problem I have here?
I want to send log data to two diffrent files depending on the logging level such as DEBUG and WARN using the same logger instance.
How can you configure this in log4j.properties.
Please post sample code for log4j.properties to achieve this.
Thanks in advance.
Anurag SInghHi,
I have tried your code. the issue is other log file for error is blank. its not writting log to that file.
following is the code of my log4j.properties
Please read the code first
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG,A1
#Appender and its layout for A1
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %log4j.appender.A1.Threshold=DEBUG
log4j.appender.A1.File=./LogonApplication_Debug.log
log4j.appender.A1.Append=true
#Appender and its layout for A2
log4j.appender.A2=org.apache.log4j.FileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %
log4j.appender.A2.Threshold=ERROR
log4j.appender.A2.File=./LogonApplication_Error.log
log4j.appender.A2.Append=true
In my logger class i have written something like this:
public static Logger myLogger = Logger.getLogger (LoggerTest.class.getName());
public static void main(String args[]){
myLogger.debug("I have logged a debug message");
myLogger.error("I have logged an error message");
Issue:
Now the problem is that it is creating two files specified in the configuration but it is logging messages both the messages debug and error in only ./LogonApplication_Debug.log file.
Though it is creating the ./LogonApplication_Error.log file, but it is only blank.
Can you please trace whats missing/wrong.
Thanks a lot.
Shanu
Maybe you are looking for
-
More than one problem with my fifth generation iopd
i just got my ipod 2 days ago. yesteday i was putting music and videos on it with no probleams.the batery died completley yesterday.when i went to charge it today, my laptop did not recognize it on my computer or itunes.but on the ipod it said please
-
I'm trying to print a document from safari and the print command is at the bottom of the page and I can't move it up. The print command shortcut doesn't work and I would like to know how I can print this document.
-
Data management and Data Recovery
Hi Friends.... Can ne1 help in the folling topics in depth.... 1) Copy a subset of BW data from one cube to another cube in another box 2) Then Deleting the original data 3) Able to reload the archived data 4) Recover the contents lost in
-
How to use tabular records ?
Below are the steps I want to : 1) retrieve data from a table 2) put these data into a mutiple records, It is a tabular records designed by the data block wizard. 3) modify data 4) save data into another table thx
-
Hello, I've created some JSP pages with JDeveloper. When I want to create a new record in a table, then have I to fill in an unique ID for this record. Is it possible to get this field automatically filled in with an unique ID ? With Oracle, it's not