Problem in Rolling to new a log file only when it exceeds max size (Log4net library)
Hello,
I am using log4net library to create log files.
My requirement is roll to a new log file with name appended with timestamp only when file size exceeds max size (file name ex: log_2014_12_11_12:34:45 etc).
My config is as follow
<appender name="LogFileAppender"
type="log4net.Appender.RollingFileAppender" >
<param name="File" value="logging\log.txt" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="2" />
<maximumFileSize value="2MB" />
<staticLogFileName value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern"
value="%-5p%d{yyyy-MM-dd hh:mm:ss} – %m%n" />
<conversionPattern
value="%newline%newline%date %newline%logger
[%property{NDC}] %newline>> %message%newline" />
</layout>
</appender>
Issue is date time is not appending to file name.
But if i set "Rolling style" as "Date or composite", file name gets appended with timestamp, but new file gets created before reaching max file size.(Because file gets created whenever date time changes, which i dont want) .
Please help me in solving this issue?
Thanks
Hello,
I'd ask the logfornet people: http://logging.apache.org/log4net/
Or search on codeproject - there may be some tutorials that would help you.
http://www.codeproject.com/Articles/140911/log-net-Tutorial
http://www.codeproject.com/Articles/14819/How-to-use-log-net
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book:
Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})
Similar Messages
-
Mailaccess.log file - How do I control size/create new mailaccess.log file
I am running an IMAP/SMTP server on a G5 Xserve. My mailaccess.log file is getting rather large. When I mv then touch to create a new mailaccess.log file the old file that was mv'd continues to get updated while the new mailaccess.log file remaile at 0 with not entries.
How to refresh my log file?
thanks
JeffHi,
http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/ee4f58ff1bce41b4dc6d2612fae211/frameset.htm
and More here..
Problem with system.log
Regards,
N. -
Problem about space management of archived log files
Dear friends,
I have a problem about space management of archived log files.
my database is Oracle 10g release 1 running in archivelog mode. I use OEM(web based) to config all the backup and recovery settings.
I config "Flash Recovery Area" to do backup and recovery automatically. my daily backup schedule is every night at 2:00am. and my backup setting is "disk settings"--"compressed backup set". the following is the RMAN script:
Daily Script:
run {
allocate channel oem_disk_backup device type disk;
recover copy of database with tag 'ORA$OEM_LEVEL_0';
backup incremental level 1 cumulative copies=1 for recover of copy with tag 'ORA$OEM_LEVEL_0' database;
the retention policy is the second choice, that is "Retain backups that are necessary for a recovery to any time within the specified number of days (point-in-time recovery)". the recovery window is 1 day.
I assign enough space for flash recovery area. my database size is about 2G. I assign 20G as flash recovery area.
now here is the problem, through oracle online manual, it said oracle can manage the flash recovery area automatically, that is, when the space is full, it can delete the obsolete archived log files. but in fact, it never works! whenever the space is full, the database will hang up! besides, the status of archived log files is very strange, for example, it can change "obsolete" stauts from "yes" to "no", and then from "no" to "yes". I really have no idea about this! even though I know oracle usually keep archived files for some longer days than retention policy, but I really don't know why the obsolete status can change automatically. although I can write a schedule job to delete obsolete archived files every day, but I just want to know the reason. my goal is to backup all the files on disk and let oracle automatically manage them.
also, there is another problem about archive mode. I have two oracle 10g databases(release one), the size of db1 is more than 20G, the size of db2 is about 2G. both of them have the same backup and recovery policy, except I assign more flash recovery area for db1. both of them are on archive mode. both of nearly nobody access except for the schedule backup job and sometime I will admin through oem. the strange thing is that the number of archived log files of smaller database, db2, are much bigger than ones of bigger database. also the same situation for the size of the flashback logs for point-in-time recovery. (I enable flashback logging for fast database point-in-time recovery, the flashback retention time is 24 hours.) I found the memory utility of smaller database is higher than bigger database. nearly all the time the smaller database's memory utility keeps more than 99%. while the bigger one's memory utility keeps about 97%. (I enable "Automatic Shared Memory Management" on both databases.) but both database's cup and queue are very low. I'm nearly sure no one hack the databases. so I really have no idea why the same backup and recovery policy will result so different result, especially the smaller one produces more redo logs than bigger one. does there anyone happen to know the reason or how should I do to check the reason?
by the way, I found web based OEM can't reflect the correct database status when the database shutdown abnormally. for example, if the database hang up because of out of flash recovery area, after I assign more flash recovery area space and then restart the database, the OEM usually can't reflect the correct database status. I must restart OEM manually to correctly reflect the current database status. does there anyone know in what situation I should restart OEM to reflect the correct database status?
sorry for the long message, I just want to describe in details to easy diagnosis.
any hint will be greatly appreciated!
Sammythank you very much, in fact, my site's oracle never works about managing archive files automatically although I have tried all my best. at last, I made a job running daily to check the archive files and delete them.
thanks again. -
I got a new pc, transferred files, and lost about 2/3 of my library. Also lost all playlists. I have a good amount on my iPod but can't transfer. What happened to my music?
iDevices are not and have never been backup devices.
Authorizing a computer does not cause media to magically appear.
Media is only where the user puts it.
Copy the ENTIRE iTunes folder from the old computer to the new computer. -
Write data to a logbook file only when a boolean indicator changes
Hello
I need to write my local variable state to a simple txt file only when it's true or false state changes.
for example, when my local variable 'temperature too high' is true, I need something like: temperature too high.
When it changes back to false i need: temperature OK. This with a date stamp.
It already worked to get a date stamp and to write the true or false state down but it always gets stuck in a while loop so the program keeps writing the same sentence.
Solved!
Go to Solution.I had to take a picture with my phone because we're not allowed to connect the computers with an usb drive, I hope you can see it clear.
I know this while loop causes the program to write the same sentence over and over again but I don't know an other way to do it right.
Thanks
Attachments:
11166065_887284134650745_1225026485_n.jpg 46 KB -
I have a problem in charging my iphone 5s it charges only when it's charge is fully out ?
i have a problem in charging my iphone 5s it charges only when it's charge is fully out ?i wonder if there is setting in the phone prevents the charging or what?i'm sure also that the cable and the charger is fine.
Hi A7med 3lam,
Welcome to the Apple Support Communities!
If you are having issues charging your iPhone I would suggest reading over the attached article and troubleshooting steps. The Resolving issues section toward the bottom of the article may be especially helpful.
iPhone and iPod touch: Charging the battery
http://support.apple.com/kb/HT1476
Have a great day,
Joe -
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 -
Need to Create a New Listener Log file 9i
Hi, I have a issue with a oracle 9i database.
First the listener.log file is 1.2G not good on a 25G server..
How do you create and delete the listener file? Windows 2000 OS...
Second I also have an issue with the archive log files... I have about 150 file 102M each...Again Not good...
Need HELP drowning in a sea of oracle... Given the Shrink command....
At least the Listener issue first then the archive log problem..
Thank you...carlo_sc wrote:
yes, we normally do a full daily backup and the archive logs are then deleted..But the Job didn't finish
last night. Also we had big Network issue yesterday and I believe that caused the issue with this server
causing an excessive amount of log files to be created...
So with simply thing with lister is just too:
1) stop listener service
2) delete Log file.... (that won't mess anything up on restart ) I'm very skittish about manually deleting stuff from oracle..
Got burned in Sept of last year big timeIt's just a log file. It's for your own use if needed. oracle doesn't use it or require it. You even have an option in the listener to not even write to it in the first place.
3) restart listener service
The archive logs : What if I move some of the files to another location then perform the a full daily backup will the that
solve my archive log issues....
Thanks for all the quick responses
Edited by: carlo_sc on Jan 15, 2010 10:09 AMYou say you already have a backup job that gets the archivelogs and deletes them after backup? And the only real problem here is that it failed? Fix the failure and run it again. You can, in a pinch, manually move the archivelogs, but then YOU are responsible for keeping up with them.
Edited by: EdStevens on Jan 15, 2010 9:32 AM -
Hi,
NWDS version : Version 7.0.17
I am unable to open NWDS.
While opening the NWDS i see an pop-up message saying below :
I have serached in forums and tried with the following steps :
1) Deleted .metadata file in Workspace, restarted my system. (Issues still persists)
2) Checked in Task manager if any instance is running Ex : "SAPIDE.exe"
In the Log file i see that there are few plugins missing as below :
!SESSION Dec 01, 2012 11:17:11.267 ---------------------------------------------
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86 -feature com.sap.java.ide - data E:\Workspace C:\Program Files\Java\jdk1.6.0_26\bin\javaw.exe
-Xmx512m
-Xms128m
-XX:PermSize=32m
-XX:MaxPermSize=128m
-DallUserDir='C:\Documents and Settings\All Users\Application Data'
-cp C:\Program Files\SAP\IDE\IDE70\eclipse\SapStartup.jar com.sap.ide.eclipse.startup.Main
-os win32
-ws win32
-arch x86
-feature com.sap.java.ide
-showsplash C:\Program Files\SAP\IDE\IDE70\eclipse\SapIde.exe -showsplash 600
- data E:\Workspace -data E:\Workspace -install file:C:/Program Files/SAP/IDE/IDE70/eclipse/
!ENTRY org.eclipse.core.runtime 2 1 Dec 01, 2012 11:17:11.283
!MESSAGE Problems encountered loading the plug-in registry.
!SUBENTRY 1 org.eclipse.core.runtime 2 1 Dec 01, 2012 11:17:11.283
!MESSAGE Plug-in "com.sap.tc.jtools.jlin.core" was disabled due to missing or disabled prerequisite plug-in "com.sap.tc.jtools.util".
!SUBENTRY 1 org.eclipse.core.runtime 2 1 Dec 01, 2012 11:17:11.283
!MESSAGE Plug-in "com.sap.tc.jtools.jlin.java" was disabled due to missing or disabled prerequisite plug-in "com.sap.tc.jtools.jlin.core".
!SUBENTRY 1 org.eclipse.core.runtime 2 1 Dec 01, 2012 11:17:11.283
!MESSAGE Unable to satisfy prerequisite constraint from "com.sap.tc.jtools.jlin.devel" to "com.sap.tc.jtools.jlin.core".
!SUBENTRY 1 org.eclipse.core.runtime 2 1 Dec 01, 2012 11:17:11.283
!MESSAGE Unable to satisfy prerequisite constraint from "com.sap.tc.jtools.jlin.ui" to "com.sap.tc.jtools.jlin.core".
!SESSION ----------------------------------------------------------------------
!ENTRY org.eclipse.core.launcher 4 0 Dec 01, 2012 11:17:19.885
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.NoClassDefFoundError: org/eclipse/ui/IStartup
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.eclipse.core.internal.boot.DelegatingURLClassLoader.findClass(DelegatingURLClassLoader.java:922)
at org.eclipse.core.internal.plugins.PluginClassLoader.internalFindClassParentsSelf(PluginClassLoader.java:166)
at org.eclipse.core.internal.boot.DelegatingURLClassLoader.findClassParentsSelf(DelegatingURLClassLoader.java:485)
at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass(DelegatingURLClassLoader.java:882)
at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass(DelegatingURLClassLoader.java:862)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.eclipse.core.internal.plugins.PluginDescriptor.internalDoPluginActivation(PluginDescriptor.java:700)
at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:188)
at org.eclipse.core.internal.plugins.PluginClassLoader.activatePlugin(PluginClassLoader.java:112)
at org.eclipse.core.internal.plugins.PluginClassLoader.internalFindClassParentsSelf(PluginClassLoader.java:185)
at org.eclipse.core.internal.boot.DelegatingURLClassLoader.findClassParentsSelf(DelegatingURLClassLoader.java:485)
at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass(DelegatingURLClassLoader.java:882)
at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass(DelegatingURLClassLoader.java:862)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.eclipse.core.internal.plugins.PluginDescriptor.createExecutableExtension(PluginDescriptor.java:130)
at org.eclipse.core.internal.plugins.PluginDescriptor.createExecutableExtension(PluginDescriptor.java:167)
at org.eclipse.core.internal.plugins.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:103)
at org.eclipse.core.internal.runtime.InternalPlatform.loaderGetRunnable(InternalPlatform.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.core.internal.boot.InternalBootLoader.getRunnable(InternalBootLoader.java:471)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:854)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sap.ide.eclipse.startup.Main.basicRun(Main.java:291)
at com.sap.ide.eclipse.startup.Main.run(Main.java:789)
at com.sap.ide.eclipse.startup.Main.main(Main.java:607)
Caused by: java.lang.ClassNotFoundException: org.eclipse.ui.IStartup
at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass(DelegatingURLClassLoader.java:866)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 41 more
Any suggestions will be appreciated!
Best Regards,
KCHave you tried this: http://help.sap.com/saphelp_nw04/helpdata/en/9d/eb813f0e614a18e10000000a114084/content.htm
Pass the VM as a argument. Make sure it is 32 bit, for NWDS 7.0 a JDK 1.4 should be used. Easiest way to try it out is to open the shell:
cmd
navigate to the directory of NWDS and enter:
SapIde.exe vm "C:\path\to\java\bin\javaw.exe" -
Problem in creating a new knowledge base file
Dear experts,
I should like to create a new knowledge base file. I use the Oracle version 9.2 and the OS is Windows 2000. I have created the thesaurus with
ctxload -user ctxsys/ctxsys -thes -thescase y -name DEFAULT -file xx.xx
and the language setting:
NLS_LANG=HUNGARIAN_HUNGARY.EE8MSWIN1250
During the compile operation
ctxkbtc -user ctxsys/ctxsys -name DEFAULT
i get the following error message:
DRG-52110: Error in writing extended knowledge base
DRG-11101: drelcHU.dat open error
Before the ctxkbtc command execution, I have created an empty directory for the expected .dat file:
ctx/data/hulx
with full control for every OS users.
What is missing or false in the commands? Where could I learn more on this special topic?
Many thanks for any help.
Best regards
Laszlomeanwhile i have found the solution :-), The name of the empty directory must be
xxlx
and not
hulx
Laszlo -
I'm having problems backing up a Hyper-V virtualized Exchange 2007 server with DPM 2012. The guest has one VHD for the OS, and two pass-through volumes, one for logs and one for the databases. I have three protection groups:
System State - protects only the system state of the mail server, runs at 4AM every morning
Exchange Databases - protects the Exchange stores, 15 minute syncs with an express full at 6:30PM every day
VM - Protecting the server hosting the Exchange VM. Does an child partition snapshot backup of the Exchange server guest with an express full at 9:30PM every day
The problem I'm experiencing is that every time the VM express full completes I start receiving errors on the Exchange Database synchronizations stating that a log file discontinuity was detected. I did some poking around in the logs on the Exchange server
and sure enough, it looks like the child partition snapshot backup is causing Exchange to truncate the log files even though the logs and databases are on pass-through disks and aren't covered by the child partition snapshot.
What is the correct way to back up an entire virtualized Exchange server, system state, databases, OS drive and all?I just created a new protection group. I added "Backup Using Child Partition Snapshot\MailServer", short-term protection using disk, and automatically create the replica over the network immediately. This new protection group contains only the child partition
snapshot backup. No Exchange backups of any kind.
The replica creation begins. Soon after, the following events show up in the Application log:
=================================
Log Name: Application
Source: MSExchangeIS
Date: 10/23/2012 10:41:53 AM
Event ID: 9818
Task Category: Exchange VSS Writer
Level: Information
Keywords: Classic
User: N/A
Computer: PLYMAIL.mcquay.com
Description:
Exchange VSS Writer (instance 7d26282d-5dec-4a73-bf1c-f55d5c1d1ac7) has been called for "CVssIExchWriter::OnPrepareSnapshot".
=================================
Log Name: Application
Source: ESE
Date: 10/23/2012 10:41:53 AM
Event ID: 2005
Task Category: ShadowCopy
Level: Information
Keywords: Classic
User: N/A
Computer: PLYMAIL.mcquay.com
Description:
Information Store (3572) Shadow copy instance 2051 starting. This will be a Full shadow copy.
=================================
The events continue on, basically snapshotting all of Exchange. From the DPM side, the total amount of data transferred tells me that even though Exhange is trunctating its logs, nothing is actually being sent to the DPM server. So this snapshot operation
seems to be superfluous. ~30 minutes later, when my regularly scheduled Exchange job runs, it fails because of a log file discontinuity.
So, in this case at least, a Hyper-V snapshot backup is definitely causing Exchange to truncate the log files. What can I look at to figure out why this is happening? -
Error:41453 in log file even when the account data is imported successfully
Hi,
As a beginner, I tried importing ‘Accounts’ record type with 2 records, by taking below 4 fields:
Account Name, Account Type, City, Owner
The email received for the account import request completion has below details:
Total Records: 2
Successfully Imported: 0
Partially Imported: 0
Duplicate Records Ignored: 0
Failed: 2
Against both the records, error : 41453 is mentioned in the log file, with error description as - An unexpected error occurred during the import of the following row: 'Account Name: <name of account>'
However when I query for the records under Account tab, the records are all created properly (with all the values correctly present). I am not sure why am I getting this error if the records are successfully imported? Any help on this would be appreciated.
In import wizard below selection was made-
Select the method Import should use to uniquely identify matching records. You can use either the External Unique ID or On Demand Row ID or the following On Demand predefined fields: Account Name, Location
* External Unique ID
If the unique record identifier of the record being imported matches a record already in On Demand:
* Don't Import Duplicate Records
If the unique record identifier of the record being imported does not match a record already in On Demand:
* Create New Record
The import process may encounter field values that do not match the picklist values for fields in Oracle CRM On Demand. Please decide how to resolve these conflicts:
* Don't Import Field Value
This option allows you to decide if import should create a new record for missing associations (related records) in your data file.
For the current import, this option will apply to the following associated record fields: Parent Account
* Create Associated Record
Thanks,
Gunjan*'Create Associated Record’ & ‘Don't Create Associated Record’*
If you are inserting Contacts. Account for that Contact is an Associated Record.
And if you gave 'Create Associated Record’ it will create Accounts for that Contact if it didn't find a matching Account and insert the Contact.
If you gave ‘Don't Create Associated Record’ it will not create Account and the Contact.
Its better to give ‘Don't Create Associated Record’ since the Account you gave in contact is case sensitive.
So if u give 'Create Associated Record’ then while inserting contact if the account is not exactly matching even though it exist in some other case(lower/upper)
it wont map to that account which you meant and will create a new Account and map it to that contact.
Hope you got some idea.
Regards,
Lemu -
Needed a code for Creating a Log File in java so that its size is limited
Hi
I need the code for developing a log file using threads so that the log file size is limited
and if the size of the log file is increasing above 1Mb,another log file has to be created automatically and the log have to be printed into that new file.
Thanks in advancepackage cms.web.log;
import java.io.*;
import java.util.Calendar;
import cms.web.WebUser;
* Log is generated by JEditor 1.0.0
* @Project : cms
* @Version : 1.0.0
* @Created date : 11:07:40 PM Thursday, 25/07/2002
* @Author :
* @Organization :
* @Copyright : (c) 2002
* An utility class used to write information, especially error messages, to
* log file so that they can be viewed at later time by administrators.
* Extra information such as date & time they occures & where they are thrown...
* are automatically included and append to the end of log file.
* Log files will increase with the format "name_n" where n is file counter
public class Log implements Serializable
* logs marker
static final String START= "\n\0";
* parent directory that contains log files
private static File parent;
private PrintStream out;
private String name;
* to count how many log for the current stream
int counter;
* maximum number of logs for each log file
int max;
public static void init(File parent)
if (!parent.exists())
parent.mkdirs();
Log.parent= parent;
public Log(String name, int max)
this.name= name;
this.max= max;
file= getLastFile();
counter= countLogs(file);
out= openStream(file);
public synchronized void appendLog(String log)
if (log == null || log.length() == 0)
return;
count();
try {
out.println(START+ counter+ " | "+ getCurrentTime()+ " | "+ log);
out.flush();
} catch (Exception e) {}
* Append the given log to log file.
synchronized void appendLog(String msg, WebUser user)
if (msg == null || msg.length() == 0)
return;
count();
try {
out.println(START+ counter+ "----------------------------------------------------------");
out.println(getCurrentTime());
out.println(user != null? "User:"+ user.getFullName(): "User: public user");
out.println(msg);
out.println("\n----------------------------- end -----------------------------\n");
out.flush();
} catch (Exception e) {}
* Append the given exception to log file
synchronized void appendLog(Throwable error, WebUser user)
if (error == null)
return;
count();
synchronized (out)
try {
out.println(START+ counter+ "----------------------------------------------------------");
out.println("Exception occured at "+ getCurrentTime());
out.println(user != null? "User: "+ user.getFullName(): "User: public user");
error.printStackTrace(out);
out.println("----------------------------- end -----------------------------\n");
out.flush();
} catch (Exception e) {}
private String getCurrentTime()
Calendar c= Calendar.getInstance();
return
parse(c.get(Calendar.HOUR_OF_DAY))+ ":"+ // 0 --> 23
parse(c.get(Calendar.MINUTE))+ ":"+ // 0 --> 59
parse(c.get(Calendar.SECOND))+ " "+ // 0 --> 59
parse(c.get(Calendar.DAY_OF_MONTH))+ "/"+ // 1 --> 31
parse(c.get(Calendar.MONTH)+ 1)+ "/"+ // 1 --> 12
c.get(Calendar.YEAR); // yyyy
private String parse(int n)
return n< 10? "0"+ n: ""+ n;
private void count()
counter++;
if (counter> max)
incrementFile();
counter= 1;
private void incrementFile()
File file= null;
int n= 0;
while ((file= new File(parent, name+ n+ ".log")).exists())
n++;
if (out != null)
out.close();
out= openStream(file);
private PrintStream openStream(File file)
try {
if (file.exists())
return new PrintStream(new FileOutputStream(file.getPath(), true));
else
return new PrintStream(new FileOutputStream(file.getPath()));
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
private int countLogs(File file)
int count= 0;
InputStream in= null;
try {
in= new FileInputStream(file);
int n;
while ((n= in.read()) != -1)
if (n == '\0')
count++;
} catch (IOException e) {
} finally {
if (in != null)
try {
in.close();
} catch (IOException e) {}
return count;
private File getLastFile()
File file= new File(parent, name+ "0.log");
File curr;
int n= 1;
while ((curr= new File(parent, name+ n+ ".log")).exists())
file= curr;
n++;
return file;
protected void finalized()
if (out != null)
out.close(); -
Log File Error when open MDS_Log from MDM Console
Hi Experts,
I am facing a problem when I tried to open MDS_Log file from MDM Console. The error message was showing as below:
Log File Error
Problems in the log file prevent Console from displaying its contents. To view log contents, open the log file in a seperate text editor.
Could any of you advise me how to open the log in a seperate text editor from MDM console ?
Thanks very much in advance
Regards,
Wei DonaHi ,
Just right click on record pane of log node and select save .it will sav to user defined location in .csv format.
Please try at yr end.
Thanks,
Sudhanshu -
Jdeveloper 11.1.1.5 - how to change path for log file for Disk quoto exceed
I am trying to deploy to my jdev integrated webserver and am getting Disk quoto exceeded error.
How do I change the path so it goes to /scratch/<user>/ ... or something other than /home/<user>
<Jul 7, 2011 1:53:01 PM PDT> <Notice> <Log Management> <BEA-170019> <The server log file /home/<user>/.jdeveloper/system11.1.1.5.37.60.13/DefaultDomain/servers/DefaultServer/logs/DefaultServer.log is opened. All server side log events will be written to this file.>
Handler: '/home/<user>/.jdeveloper/system11.1.1.5.37.60.13/DefaultDomain/servers/DefaultServer/logs/DefaultServer.log' raised exception when flushing.
Caused By: weblogic.store.PersistentStoreFatalException: java.io.IOException: Error syncing file, Disk quota exceeded, errno=122
#### Cannot run application TravelRequestApplication due to error deploying to IntegratedWebLogicServer.Set the USER Home directory as explained here:
http://download.oracle.com/docs/cd/E21764_01/install.1111/e13666/ojdig.htm#BDCJCHDF
Maybe you are looking for
-
How can I add the developer toolbar to WORD?
-
Interaction between Edge Animate and RaphaelJS (or any svg library)
Hello. Edge Animate's possibilities are really nice as long as i'm working with anything rectangular. The overall UI is very practical and so, but when you want to work with more complex shapes overlapping it gets very limitated. I've looked around w
-
Hello all trying to update a table with utl input file
Hi all please kindly help me with the below : i have a table having 100 rows ,where i have to update the vxxx_DESC column from teh input file ,when the xxx_CODE is equal to vxxx_CODE from teh input file which is 3 didgit numeric format like the below
-
Tried to reset password, update cc and still can't login to get apps or in app game currency, anybody else having trouble today?
-
Pls tell me, How can i confirm my iphone Orginal or not
Pls tell me, How can i confirm my iphone Orginal or not