Does the logging API provide  "Asynchronous File Handler", like log4j ?

Hi,
One more question about java.util.logging:
Does sun provide a standard "Asynchronous File Handler", equivalent to log4j AsyncFileAppender ?
The idea is, logging requests are placed into a queue, which is being consumed by a dedicated logging-IO thread.
Thanks.

it's a shame, really. the Logging API was blatantly inspired by Log4J, but it's just such a poor cousin in so many ways...

Similar Messages

  • Log API: daily roling file appender?

    my task is to replace Log4J with the JDK 1.4 logging API. how can i configure the logging to have a FileHandler that does daily rolling (like Log4J DailyRollingFileAppender) and offer a a date pattern for the file name (like Log4J DatePattern)?
    the result should be that each day, a new log file is created with the old files having a datepattern in the file names.

    Well, i wrote my own now, that supports time rolling (day, week, month, year) and later additional rollings. here's a start:
    import java.io.*;
    import java.text.SimpleDateFormat;
    import java.util.*;
    import java.util.logging.*;
    * File handler that supports different kind of rolling than java.util.logging.FileHandler.
    * Supported rolling methods are: by date (day).
    * <p>
    * Example of entries in the logging file (system property "java.util.logging.config.file"):
    * <p>
    <table align="center" bgcolor="#ddddff" border=1 cellpadding="10" cellspacing="0"><tr><td><pre>
    logging.RollingFileHandler.level = FINEST
    logging.RollingFileHandler.prefix = MyApp_
    logging.RollingFileHandler.dateFormat = yyyyMMdd
    logging.RollingFileHandler.suffix = .log
    logging.RollingFileHanlder.cycle=day
    logging.RollingFileHandler.formatter = java.util.logging.SimpleFormatter
    </pre></td></tr></table>
    <p>
    * @version $Revision:$ ($Date:$)
    * @author $Author:$
    public class RollingFileHandler extends StreamHandler {
        /** File prefix. */
        private static String prefix = null;
        /** Date format to use in file name. */
        private static String dateFormat = "yyyy-MM-dd"; //default
        /** File suffix. */
        private static String suffix = null;
        /** Time in milliseconds for the next cycle */
        private static long nextCycle = 0;
        /** Time cycle (for file roling) */
        private static String cycle = "day"; //default
         * Constructor.
        public RollingFileHandler() {
            super();
            LogManager manager = LogManager.getLogManager();
            String className = RollingFileHandler.class.getName();
            prefix = manager.getProperty(className + ".prefix");
            String dfs = manager.getProperty(className + ".dateFormat");
            suffix = manager.getProperty(className + ".suffix");
            String c = manager.getProperty(className + ".cycle");
            String formatter = manager.getProperty(className + ".formatter");
            if (dfs != null) {
                dateFormat = dfs;
            if (c != null) {
                if (c.equalsIgnoreCase("day") || c.equalsIgnoreCase("week") || c.equalsIgnoreCase("month") || c.equalsIgnoreCase("year")) {
                    cycle = c;
            if (formatter != null) {
                try {
                    setFormatter((Formatter) Class.forName(formatter).newInstance());
                } catch (Exception e) {
                    e.printStackTrace(System.err);
            openFile();
        }//RollingFileHandler()
          * Open existing or create new log file.
         private synchronized void openFile() {
            //create file name:
            String dateString = dateFormat; //default (to note error in file name)
            Date currentDate= new Date();
            try {
                SimpleDateFormat sdf = new SimpleDateFormat(dateFormat, Locale.getDefault());
                dateString = sdf.format(currentDate);
            } catch (IllegalArgumentException iae) {
                /* ignore wrong date format */
            //compute next cycle:
            Date nextDate = null;
            GregorianCalendar gc = new GregorianCalendar();
            gc.setTime(currentDate);
            if (cycle.equalsIgnoreCase("week")) {
                gc.add(Calendar.WEEK_OF_YEAR, 1);
                nextDate = gc.getTime();
            } else if (cycle.equalsIgnoreCase("month")) {
                gc.add(Calendar.MONTH, 1);
                int month = gc.get(Calendar.MONTH);
                int year = gc.get(Calendar.YEAR);
                GregorianCalendar gc2 = new GregorianCalendar(year, month, 1);
                nextDate = gc2.getTime();
            } else if (cycle.equalsIgnoreCase("year")) {
                gc.add(Calendar.YEAR, 1);
                int year = gc.get(Calendar.YEAR);
                GregorianCalendar gc2 = new GregorianCalendar(year, 0, 1);
                nextDate = gc2.getTime();
            } else { //day by default
                gc.add(Calendar.DAY_OF_MONTH, 1);
                nextDate = gc.getTime();
            //to zero time:
            gc = new GregorianCalendar();
            gc.setTime(nextDate);
            gc.set(Calendar.HOUR, 0);
            gc.set(Calendar.HOUR_OF_DAY, 0);
            gc.set(Calendar.MINUTE, 0);
            gc.set(Calendar.SECOND, 0);
            gc.set(Calendar.MILLISECOND, 0);
            nextDate = gc.getTime();
            nextCycle = nextDate.getTime();
            //create new file:
            String fileName = prefix + dateString + suffix;
            File file = new File(fileName);
            //create file:
            if (!file.exists()) {
                try {
                    file.createNewFile();
                } catch (IOException ioe) {
                    ioe.printStackTrace(System.err);
            //set log file as OutputStream:
            try {
                FileOutputStream fos = new FileOutputStream(file, true);
                setOutputStream(fos);
            } catch (FileNotFoundException fnfe) {
                reportError(null, fnfe, ErrorManager.OPEN_FAILURE);
                fnfe.printStackTrace(System.err);
                setOutputStream(System.out); //fallback stream
        }//openFile()
         * Overwrites super.
        public synchronized void publish(LogRecord record) {
            if (!isLoggable(record)) {
                return;
            super.publish(record);
            flush();
            //check if we need to rotate
            if (System.currentTimeMillis() >= nextCycle) { //next cycle?
                role();
        }//publish()
          * Role file. Close current file and possibly create new file.
         final private synchronized void role() {
            Level oldLevel = getLevel();
            setLevel(Level.OFF);
            super.close();
            openFile();
            setLevel(oldLevel);
        }//rotate()
    }//RollingFileHandler

  • Where does the logging in RDBMSRealm go  --and-- are some JavaDocs missing?

    I see that a LogOutputStream is created in the example
    class RDBMSRealm, but where do all of the log
    statements go. The LogOutputStream is created as:
    log = new LogOutputStream("RDBMSRealm");
    but I do not see and file called RDBMSRealm and/or
    I do not see the log statements on stdout.
    BTW, I do have logging set to the most detailed
    level (Info) from the console if this matters.
    Also, are there some JavaDocs missing from
    Weblogic's Reference website at
    http://edocs.bea.com/wls/docs60/javadocs/index.html
    LogOutputStream is an example. I do not see the
    class when I select the package
    weblogic.logging.
    Where is it?
    Much Thanks
    Bill Ralenkotter.

    Thanks Terry,
    Sorry, I should have mentioned that I am using WL6.0.
    Does anyone know what I need to do to get the RDBMS Realm log to start on
    WL6.0.
    About the missing JavaDocs: Also, if I am doing development using these
    classes I still do not
    understand why they are not on the 6.0 refernce site!
    About the missing JavaDocs,
    I see java docs for a lot of classes, but what document do I use that
    helps me to understand the entire framework? The Programming
    Weblogic Security does give this information.
    Example question: how do I get a reference to the realm to create
    users? Should I even be doing this?
    Thanks for your help.
    Bill.
    "THorner" <[email protected]> wrote in message
    news:B4D7B3CBF165D311844100C04F4E3E1B031246@DANCERACE01...
    If you are using WLS5.1 you much set the property
    weblogic.security.realm.debug=true
    then this information will be sent to stdout. This is set to false by
    default, as there is a lot of information, and it is a big performance
    hit.
    I think weblogic likes to avoid some of its APIs being public, which is
    annoying at times, but probably reasonable
    terry
    -----Original Message-----
    From: Bill Ralenkotter [mailto:[email protected]]
    Posted At: Thu 03 May 2001 16:00
    Posted To: weblogic.developer.interest.security
    Conversation: Where does the logging in RDBMSRealm go and are some
    JavaDocs missing?
    Subject: Where does the logging in RDBMSRealm go and are some
    JavaDocs missing?
    I see that a LogOutputStream is created in the example
    class RDBMSRealm, but where do all of the log
    statements go. The LogOutputStream is created as:
    log = new LogOutputStream("RDBMSRealm");
    but I do not see and file called RDBMSRealm and/or
    I do not see the log statements on stdout.
    BTW, I do have logging set to the most detailed
    level (Info) from the console if this matters.
    Also, are there some JavaDocs missing from
    Weblogic's Reference website at
    http://edocs.bea.com/wls/docs60/javadocs/index.html
    LogOutputStream is an example. I do not see the
    class when I select the package
    weblogic.logging.
    Where is it?
    Much Thanks
    Bill Ralenkotter.

  • Does the iMessage protocol provide for "online status" indication?

    In iChat, I could set the online status of my AIM account ("Available", "Away", etc.).
    Does the iMessage protocol provide for "online status" indication?

    HI,
    Messages Beta can do the same indications for the older style iChat Buddy List the same as iChat does/did.
    The iMessage Login (the "Account" in the Messages Menu > Preferences > Accounts that deals with sending iMessages to iPhones and iPads) does not have the same indicators.
    What it does do is indicate the options in the "To" spot for the Name that is currently shown there.
    To explain that a bit further.
    When you click New Message the Blue Plus icon appears
    You can select Contacts from this list and navigate to a Contact in the Address Book
    Once you select a Contact their Name is in the "To" spot
    If you now click this it becomes a Drop down and the iMessage details they have are marked with a blue Speech bubble.
    IF you select an iMessage Contact this way and they are Off Line the name will go red.
    9:53 PM      Monday; May 14, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Does the iPod nano support MP4 files?

    Does the ipod nano support mp4 files?????

    Hi uptight,
    Yes, the iPod Nano does support MP4 files.
    You can find more information about the files the iPod supports here: http://www.apple.com/ipodnano/specs.html
    You can convert many videos right from iTunes. This article: http://support.apple.com/kb/HT1211 will walk you through the process with sample files.
    -Jason

  • Does the Ipad2 support .epub (ebook) files?

    Does the Ipad2 support .epub (ebook) files?
    And: does it support websites built with flash?

    Epub boooks are supported. There are a number of different ebook apps, and generally books are locked (due to digital rights management systems) to the app/retailer that they were bought from e.g. iBooks (Apple), Kindle (Amazon), Barns & Noble, Nook - so won't be able, for example, buy a book from Amazon and read it it iBooks, you'll have to use the Kindle app.
    Flash is not supported on any iOS device (iPad, iPhone, iPod Touch). Some apps claim to (e.g. Skyfire) but judging from the reviews the results are varied. More info on why it's not supported here http://www.apple.com/hotnews/thoughts-on-flash/

  • We are looking for a software which converts SWF to MP4, we found many software which does the job but issue is file size is not optimize.  We found Adobe captivate 6 which gives optimum quality with good output but thing is we do not have batch process i

    Hi
    We are looking for a software which converts SWF to MP4, we found many software which does the job but issue is file size is not optimize.
      We found Adobe captivate 6 which gives optimum quality with good output but thing is we do not have batch process in captivate 6. so we request you to create a plugin or give a best option which have batch render quality and optimize in file size,

    Captivate is e-learning development software not a dedicated video convertor, you are better off trying something like Adobe Media Encoder or Super.

  • Why does the Java API use int instead of short or byte?

    Why does the Java API use int if short or even byte would be sufficient?
    Example: The DAY_OF_WEEK field in Calendar uses int.

    One of the point is, on the benchmark tests on Java performance, int does far better than short and byte data types.
    Please follow the below blog talks about the same.
    Java Primative Speed
    -K

  • Does the Airport extreme provide any sort of usage reporting? Either per user or aggregate usage of the broadband port

    Does the Airport extreme provide any sort of usage reporting?  Either per user or aggregate usage of the broadband port

    No. You may be able to retrieve that information from your ISP.

  • What Does The Log Message "Rejecting update: Lease..." Mean?

    I use RelicatedCache and TransactionMap on Coherence 3.4.2.
    I saw "Rejecting update: Lease..." message.
    What does the log message mean?
    2011/10/18 06:41:57.506 [DEBUG] Logger@9263394 3.4.2/411p16 N/A NOAH Coherence 3.4.2/411p16 [D4] (thread=ReplicatedCache, member=2): Rejecting update: Lease: [-8863526970089418959, -2793231267399579492, R] (Cache=issue-code, Size=Unknown, Version=0/0, IssuerId=1, HolderId=0, Status=LEASE_AVAILABLE, Last locked at Thu Jan 01 09:00:00 JST 1970)
    by member=2, Lease: [-8863526970089418959, -2793231267399579492, R] (Cache=issue-code, Size=143, Version=0/0, IssuerId=2, HolderId=0, Status=LEASE_AVAILABLE, Last locked at Tue Oct 18 06:41:51 JST 2011)
    I found a Note 1065352.1, but the message is little differnt...
    Note 1065352.1
    "What Does The Log Message "Rejected update: Lease..." Mean?"I'd like to know following 2 points..
    - What does "Rejecting update: Lease..." message mean?
    Do thsese messages have same meaning?
    - My application didn't catch any exceptions, and
    "CacheFactory.commitTransactionCollection" returned true.
    So this "Rejecting update: Lease..." is not a error message, right?
    (Does the transaction commited successfully?)
    Thanks in advance.
    -Noriyuki

    Hi
    These are decoded results of the error message which u have recd in ur box..
    %C4K_PKTPROCESSING-4-ERRORPACKET: [char]
    The software is unable to process a packet; the packets have been forwarded to the CPU instead and the packet will be dropped.
    Recommended Action: This is an informational message only. No action is required.
    %C4K_HWACLMAN-4-WARNINGSTRING: [char]
    A nonspecific warning message was displayed.
    Recommended Action: See the message string [char] for more information.
    Related documents- No specific documents apply to this error message
    %C4K_HWACLMAN-4-WARNINGSTRING: [char]
    A nonspecific warning message was displayed.
    Recommended Action: See the message string [char] for more information.
    Related documents- No specific documents apply to this error message.
    regds

  • Does the latest version of Numbers have anything like Excel's goal seek?

    Does the latest version of Numbers have anything like Excel's goal seek?  I frequently use goal seek to solve non-algebraic equasions for an unknown.  Thanks.

    I went through the installation where the bar shows the percentages downloaded and installed. Once it shows 100% it asks me to click Finish. I do. Then I go to yahoo to check and it continues to show that the plugin is missing and that I need to download Adobe Flash which I thought that I just did. Am I missing something in terms of installing??
    Kent M. Farrar

  • Try doing the update would not download. So like a dummy I did what I went and downloaded the new itunes so it would update itunes did it before and it worked at first it would tell me that I was missing MSVCR80.dll so I downloadeditagainandnowitwon'twork

    try doing the update would not download. So like a dummy I did what I went and downloaded the new itunes so it would update itunes did it before and it worked at first it would tell me that I was missing MSVCR80.dll so I downloaded it again and reinstalled it and now it won't work at all

    Apple isnt here. this is a user based forum for technical questions. The solution is to restart, reset, and restore as new which is in the manual after that get it replaced for hard ware failure. if your within your one year warranty its replaced if it is out of the warranty then it is 199$

  • Does the Communications API work with Studio 4

    I just installed Studio 4 along with the JDK. The Java version that I am running now is:
    java version "1.4.1_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
    Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
    Running on MS XP.
    The Communications API seemed to work just fine on JDK 1.3 with Forte 1.0.
    I installed the Comm API as instructed and set my ClassPath:
    CLASSPATH=D:\PROGRA~1\s1studio_jdk\j2sdk1.4.1_02\lib\comm.jar;D:\MyProjects\java\GarxFace
    A call to:
    Enumeration portList;
    portList = CommPortIdentifier.getPortIdentifiers();
    does not yield any ports at all.
    Stranger yet, if I use the auto complete feature in the editor. For example if I type: m_PortID. then no members of PortID show up.
    But the code compiles just fine.
    Any idea what is going on?

    First I found the reason that the auto complete was not working. I had to mount the comm.jar file (you did not have to do this in Forte 1,0, just set the classpath). I thought that I had done that. That is the problem when you work late. ;)
    Here is a eexcerpt that I found on a search in another post:
    Copy javax.comm.properties to your <JDK>\lib directory.
    C:\>copy c:\commapi\javax.comm.properties c:\jdk1.1.6\lib
    The javax.comm.properties file must be installed. If it is not, no ports will be found by the system.
    Notice it says that "javax.comm.properties file must be installed"
    javax.comm.properties is indeed installed in my JDK lib subrirectory, but it is almost like it is not being found.

  • Why does the Palm Centro save my files as .php files?

    Okay so I've been trying to download files from the internet and save them on my Centro. When I click on the link to download it, it shows the file as a .doc file which is good because it's a microsoft word file. but then when I actually click "Save", the file changes to "download.php" and I can't open the .php file on my Centro. So my question is, Why does the .doc file change to the .php file? And more importantly, how can I save the .doc file without it changing to .php?

    Hi.. Welcome to the Palm forums.  Any Palm device is going to convert any file saved to it to the format it needs to be able to read it.  For .doc files, word documents, you need docs to go which comes with your centro for free. Docs to go 10 is required for office 2007 and is available free for a centro, go to www.palm.com/us/support  select downloads under support & downloads then select a centro and you will see a link for bonus software on your cd.  Find docs to go, download it to your computer and install.  Then sync which will update and/or install docs to go 10 on your computer and your centro.  Once that is accomplished if you want to put a office file on you centro you open docs to go on your computer, add in the office file and sync.  After that if you update the file either on the centro or on the computer then sync both files will end up the same after the sync.
    Post relates to: Centro (Sprint)

  • How does the ActionScript API, Eclipse IDE, Flex SDK, Cygwin & Flex Builder all communicate??

    Whats up Everyone! As you might've immediately recognized from the title of this thread I'm new to developing apps with Flex.....
    If I've succesfully set up my development environment (Flex SDK, Eclipse IDE, JAVA SDK, Apache Ant, Flash Player, etc.....) & checked out the source code using Subversion, can I start developing my app using the ActionScript 3 API using Eclipse? & how do those different SDK's & programs communicate? How should they be setup?

    If you're willing to buy into the FlexBuilder way of doing things, that's probably the way to go. In this case, you don't really need to worry about anything except FlexBuilder (at least for a while). I don't really have any experience in setting up a project with a server component (I always set 'server type' to 'None' and configure this manually), but other than that, the experience has been (fairly) smooth, and I'm someone who's pretty heavily biased towards the command line. FlexBuilder takes care of most of the Flex compiler options, tracking different SDK versions (I have three different ones installed), offers code completion and navigation tools, etc.
    To get some of the terms straight (I'm not sure how familiar you are with these, since you just threw them out there--pardon me if I'm being patronizing):
    * the ActionScript API: the function and class definitions built into Flash Player (fl.*) and the Flex standard library (mx.*)
    * Eclipse: a Java IDE, the core of FlexBuilder
    * Flex SDK: the Flex standard library, the mxml and compc flex compilers, some ant tasks for build automation, etc.
    * Cygwin: this does not really have anything to do with Flex specifically, as far as I'm aware--it's a *nix emulation layer for Windows
    * FlexBuilder: the Flex IDE from Adobe, built as a plug-in to Eclipse
    FlexBuilder is available in standalone (i.e., pre-bundled with Eclipse) and plug-in versions. Both versions include the SDK. If you're just starting out, I would suggest a FlexBuilder standalone trial, and follows some tutorials out there (or, really, just chose "new Flex project" and explore). In this case, you don't really have to worry about installing or configuring anything else to get started.
    Note also that for the upcoming Flex 4, FlexBuilder has been renamed Flash Builder (but I would stick with Flex 3.4 or 3.2 right now unless you really likethe bleeding edge).

Maybe you are looking for

  • How can I sync my iPhone and leave my podcasts alone?

    I frequently have a bunch of PDFs and photos that I want to move back and forth between my computer and iPhone the file sizes are too large to efficiently email them back and forth one at a time I also have a bunch of podcasts I download directly to

  • How do I change the Background Color of a Shape in iWeb?

    I am adding a comment bubble from the Shape menu for one of my photos. Everytime I try to change the background color of the bubble I end up changing the entire background color of the Web Page. How do I only change the background color of the shape?

  • Inability to connect laptop to printer connected to new desktop windows 7-64bit

    We cannot connect our officejet 5500 to our laptop since buying a new desktop computer now running Windows 7-64 bit. Although the laptop runs on Windows 7, it previously was able to access the printer. Since upgrading the computer we seem not to be a

  • Add bookmarks to pdf file using Excel VBA

    Good morning - I have, through internet searches, created an Excel macro that prints numerous workbooks to pdf, combines them into one file and prints that file.  I have been searching for the last piece, which is adding bookmarks, but have not had a

  • FAQ SUGGESTION - DELL US

    Queries on card problems should be addressed to Dell or the Dell Forum as your Audigy Soundcard is not the same as the retail version and uses different drivers and is supplied with different software.