Log4j - logging different levels into different files??

hi, i wonder if it is possiple to log different logging levels to different files. for example: i want all info,debug and warning messages to be logged into file a.log and all error messages into b.log. has anybody an existing property files which shows how to do that?? thanx a lot.

i googled like hell but couldn't find a good
example...err.Really?
http://jakarta.apache.org/log4j/docs/manual.html

Similar Messages

  • Putting lots of different pictures into different pdf-files together

    hi there,
    my boss gave me a tricky task and I dont know how to solve the problem without some help. It's about putting lots of different pictures into different pdf-files together. May be you have some ideas how to succeed. Please excuse my german-laced english.
    My task is to merge (or put together) about 4-5 pictures into one pdf. the problem: i have 4.000 pictures. the advantage: the pictures that i have to merge are named pretty similar, it looks like:
    ab_pictures 1
    ab_pictures 2
    ab_pictures 3
    ab_pictures 4
    ab_pictures 5
    cd_pictures 1
    cd_pictures 2
    cd_pictures 3
    cd_pictures 4
    ef_pictu...etc.
    i have to merge ab-picuteres 1-5 to one pdf called "ab_pictures 1", cd_pictures to one pdf called "cd_pictures 1"...
    because there are so many picture-groups that i have to merge i was wondering if there is a possibility to automate this task by just telling the programm once what it has to, so it can do it without me sitting next to it, telling it each time what it should do next.
    this would safe me a lot (!) of time. Here at my working place there is adobe acrobat reader 9 running, there is also distiller available (I dont know what this appclication is used for).
    my question: is it possible to "programm" acrobat that i could do such a task automatically? Or do I have to buy other programms (may be a database-programm or something like that) to be able to it?
    thank you very much in advance for your expertise and please excuse my german-laced english.
    regards,
    scoutee1

    Two locations, for Acrobat Scripting, that may be helpful.
    #1. Acrobat Scripting here in the Adobe Forums.
    http://forums.adobe.com/community/acrobat/acrobat_scripting
    #2. Acrobat User Community's JavaScript Forum.
    http://acrobatusers.com/topics/javascript
    edit: above link is to AUC Learning Center content.
    The forum is at:
    http://acrobatusers.com/forums/acrobat-discussions-topic/javascript
    Be well...
    Message was edited by: CtDave

  • Logging app messages into another file than server.log

    Hello:
    I'm working with Application Server Enterprise Edition 7 2004Q2 and I'd like logging application messages into another file than server.log.
    I tried to set up a logging configuration file as
    com.appname.handlers = java.util.logging.FileHandler
    ( where all packages in my application are named like com.appname.* )
    and pass it as
    -Djava.util.logging.config.file
    But nothing happens. Indeed , no file is created.
    I tried with
    handlers = java.util.logging.FileHandler
    and works fine but, obviusly, are wrote server messages too.
    So, the problem is 'com.appname.handlers ' property, but I dont know why.
    any workaround to perform this ?
    what's wrong ?
    Thanks in advance.
    Best regards

    Hi,
    The samples are usaully in the samples directory of the appserver install dir. However, this might depend on the server install.
    Anyway, samples can be downloaded from:
    http://developers.sun.com/prodtech/appserver/reference/codesamples/index.html
    This is a zip file with all the samples stuff
    The actual code in there:
            // import for logging classes
            import java.util.logging.*;
            //Remove all handlers
            Handler[] h = logger.getHandlers();
            for (int i = 0; i < h.length; i++) {
                logger.removeHandler(h);
    //Set it to its parent handler so that it gets NOT (by Robert) printed on the server log
    // In the original sample this is set to true
    logger.setUseParentHandlers(false);
    The actual way of adding your own file log handler:
         // Create a file handler with a string as parameter for filename
          Handler fh = new FileHandler(<LOGFILENAME>);
           // Create a formatter to format the logger
           fh.setFormatter(new SimpleFormatter());
           // Add the handler to logger instance 
           logger.addHandler(fh);See the javadocs for formatting stuff,
    HTH Robert

  • Load different thumbnails into different movieclips

    I'm creating a gallery and having a problem loading thumbnails into different MovieClips. I have all the MCs stored into an Array. I could load them if I wanted to type out:
    var thumbLoader1:Loader = new Loader();
    movieClipName1.addChild(thumbLoader1);
    but I would think there's a more dynamic way. Right now Im stuck at:
    var imageThumbNames:Array = new Array
    function photoLoaded(event:Event):void
        trace ("photo loaded");
        trace (xmlData.Person.length());
        imageThumbNames[photoNumberLoaded] = "image" + photoNumberLoaded;
        var image:Bitmap = event.target.content as Bitmap;
        image.smoothing = true;
        thumbHolderArray[photoNumberLoaded].addChild(image);
        if (photoNumberLoaded < xmlData.Person.length() && photoNumberLoaded < numberOfThumbs)
            photoNumberLoaded += 1;
            addThumbs();
    I tried switcing the var "image" with a name from the "imageThumbNames" array but that would've been too easy. Any help is greatly appreciated.

    var thumbLoader1:Loader = new Loader();
    movieClipName1.addChild(thumbLoader1);
    var imageThumbNames:Array = [your image files];  // populate in for-loop
    var photoNumberLoaded:uint=0;
    addThumbs();
    function photoLoaded(event:Event):void
        trace ("photo loaded");
        trace (xmlData.Person.length());
        //imageThumbNames[photoNumberLoaded] = "image" + photoNumberLoaded;
        var image:Bitmap = event.target.content as Bitmap;
        image.smoothing = true;
    //not sure if this is the right thing to add to add these loaders to
        thumbHolderArray[photoNumberLoaded].addChild(mc.getChildAt(0));
    photoNumberLoaded += 1;
        if (photoNumberLoaded < xmlData.Person.length() && photoNumberLoaded < numberOfThumbs)
            addThumbs();
    var mc:MovieClip=new MovieClip();
    function addThumbs(){
    mc["loader_"+photoNumberLoaded]=new Loader();
    var urlR:URLRequest=new URLRequest(imageThumbNames[photoNumberLoaded]);
    mc["loader_"+photoNumberLoaded].addEventListener(Event.COMPLETE,photoLoaded);
    mc["loader_"+photoNumberLoaded].load(urlR);

  • Two audio tracks/different levels on different televisions

    I am contemplating purchasing the FCPDVDSP bundle, but before I do, a question...
    When I played back my DVD at a retailer, on different televisions, on different DVD players, the picture looked great. The sound was also perfect on televisions with built in speakers. However, on televisions with external speakers, the voice-over was fine, but the music track was too soft.
    It's been recommended I go pro at this point, but I'm trying to understand the principles. Why would a DVD's balance sound fine played back on a TV with built-in speakers and not on a TV with external, amplified speakers? And how would DVDSP help solve this issue?
    I realize I'm living in the imovie/idvd universe at the moment, so thank you for your help!

    Nah you are not wearing out anything
    In iDVD the audio is PCM (uncompressed) while in DVD SP you can use compressed audio (AC3) which helps in general playback situations due to less bandwidth (less skipping with lower rates) and some DVD Players behave better with AC3
    (There was some issues with some players and PCM audio awhile back, my friend had a funky player, but I would not set this aspect as a rule.)
    Techincally there are more things available to use in DVD SP in general and in general should be able to do things better, yet there was something that iDVD did better from a tech side in building a DVD (do not know if it still is the case with the recent versions of DVD SP and iDVD) where iDVD placed certain files. That being said, I also have friends who have players that play iDVD authored discs no problem, but for some reason DVD SP authored discs cause the players fits (even on discs I go and tweak with some other tools to remove anything that causes problems). Note these are when discs are burned from computers and not actual replicated discs.. go figure
    Not sure if this helps at all
    In general if you think you will be doing movies and DVD authoring often, and probably more so for other people, you may want to look at the Final Cut Studio, some great programs. I am not sure if your only concern is audio on DVDs you burn from your computer playing properly on various players will justify your cost of the entire thing.
    On the other hand, the iApps are very powerful also and you can do alot with them.

  • Loading different banners into html file depending on screen width? (Responsive)

    I have a html file that has my banner in it. I call my banner into the html file with this script in the head section: <script type="text/javascript" charset="utf-8" src="banner_edgePreload.js"></script>
    I also have a second banner called banner2. So all I have to do to switch the banners in my html file is put a 2 after the word banner in the script above ^ because they use the same resources.
    Now im trying to get it to change from banner to banner2 when screen width is 1200 or less.
    I was using this code but it doesn't seem to be working:
    <script type="text/javascript" charset="utf-8" src="banner_edgePreload.js"></script>
    <script type="text/javascript" charset="utf-8" media="screen and (max-device-width: 1200px)" src="banner2_edgePreload.js"></script>
    Any ideas on how I can get this to work?
    Thanks!

    Not sure if this is what you are looking for
    Different Banners (and sizes) for different pages? - Squarespace Answers

  • In I-Tunes, how can I consolidate multiple copies of the same album with different tracks into one file in my library screen?

    In Windows 7 , I tunes library/ albums, I have many albums ( all the same) with different tracks in each.
    Is it possible to consolidate the multiple cover photos into one ?

    Generally setting a common Album Artist will fix things, if not see Grouping tracks into albums.
    tt2

  • Sending log data to two different files using log4j

    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.
    How can you configure this in log4j.properties.
    Please post sample code for log4j.properties to achieve this.
    Thanks in advance.
    rsreddych

    Hi,
    Finally, I found the solution to this problem my self.
    What you need to do is define two loggers in the application, and set two priority levels to these loggers and define two out put files to these loggers. Deploy the war file, restart application server and you are good to go.
    This seems to be working for me. Only glitch I found is, the out put in
    the second file is displaying one space character at the start of line starting from second line (First line don't have this problem). This is odd. It may be because of my faulty code. Any how thanks for you all.
    rsreddych

  • 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 SIngh

    Hi,
    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

  • Custom logging, multiple apps in one file, different from server.log

    I have several applications running on my integration server. I would like to log from these apps to a single file (different file from server.log)
    I tried to use custom log4j logging, but there's a problem with the RollingFileAppender. Whenever a file is rolled, the backup copies are deleted. It probably happens because different classloaders load different apps and I configure the log4j in every app, but I don't understand classloaders.
    Here is a part of the log4j.properties file:
    log4j.appender.file=org.apache.log4j.RollingFileAppender
    log4j.appender.file.File=/path/log
    log4j.appender.file.maxBackupIndex=10
    log4j.appender.file.maximumFileSize=10485760and I configure the logger in every app by
    org.apache.log4j.PropertyConfigurator.configure( logPropertiesPath );(Is this wrong? Is it even possible to use one log file from different apps? The integration servers does it...)
    I don't need the log4j, if the internal logging can be set up to log app. messages to a different file and configured with a different layout pattern, it would be enough.
    Can anybody please help with my logging problem?

    I've tried this:
    I've put log4j.jar to the lib dir of the logicalhost and log4j.properties to another jar (my own) and put it to the lib dir too. I deleted the PropertyCOnfigurator.configure() line from the apps. Built it, manually deleted log4j.jar from the EARs. Then I deployed EARs, restarted the domain and ran the apps. They both logged to the same and correct file, but again the rolling didn't work. How is this possible? I thought that this way the IS should have one and only one instance of Log4j...

  • I cannot import my AVCHD files by using log and transfer. I can see all the files, but when I add the file to import que it doesnt work, the status is a red (!) and says that its no data. I have tried with different cards and different cardreaders, but it

    I cannot import my AVCHD files by using log and transfer. I can see all the files, but when I add the file to import que it doesnt work, the status is a red and says that its no data. I have tried with different cards and different cardreaders, but it is still the same. Why?!

    Please give us more specific information -
    What make/model camcorder are you using?
    Are you absolutely certain this is AVCHD video?  Tell us more about the video settings you used in the camcorder (eg, frame size, frame rate, quality level)
    Why are you attempting Log & Transfer from a card reader instead of from your camcorder?  Have you tried doing Log & Transfer from your camcorder?
    Are the SD cards straight from the camcorder, unaltered, or are you just using the cards as storage?
    Are you using FCE 4.0 or FCE 4.0.1?

  • I have two different itunes music files on my computer.  How do I combine them into one file?

    I have two different itunes music files on my computer.  How do I combine them into one file?

    I don't think so. The only other ID I have is a developer id, and I didn't get that until several months after I got the phone. In addition purchases I made from the App Store onthe phone would sync up with It unes on the Mac meaning it would be the same id.
    However I looked at the AppStore on my phone while it was connected to the Mac with iTunes open, and now the balance has changed to the same as the others.

  • Drop the files into different directories based on the filename

    Hi,
    I had a reqiuirement based on the file name, i should drop the files in to different directories.
    I can get the filename through variable substitution in receiver file communication channel, now i want to drop the file into different folders based on conditions.
    suppose, if the file name is DDDX234
    i should do substring of filename0+(4), if the value is L then i should drop in X directory
    suppose, if the file name is DDDY234
    i should do substring of filename0+(4), if the value is L then i should drop in Y directory.
    How can i drop the file into differnent directories based on filename.
    Thanks
    Srinivas

    Thanks Michal,
    I mapped the directory and filename to the target header in the mapping
    Filename --> UDF --> Header(target)
    and in the receiver channel checked the ASMA and given * in the filename and directory name.
    But in runtime iam getting the error as
    Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
    MY UDF is
    public String Directory(String a,Container container){
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key  = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
    String FileName = conf.get(key);
    FileName = a;
    conf.put(key, FileName);
    %%%based on filename the directory should change
    String Directory = conf.get(key1);
    Directory = "/SAPInterface/XI/PPD/DHX/out";
    conf.put(key1, Directory);
    return "";
    Help me in correcting this error.
    Thanks
    Srinivas

  • Ability to process several raw files with the same content but with different exposure into the single picture

    Can you add to the Lightroom an ability to process several raw files with the same content but with different exposure into the single picture?
    Base raw files can be given with exposure bracketing during shooting, for example.
    The goal - to get maximum details in darks and lights (if we use the "ligths recovery" or "fill lights" we lose the quality because raw file just have no all required information).
    The similar (but not the same, only the idea) thing - is High Dynamic Range Photography in Adobe Photoshop
    Thank you

    The plugin LR/Enfuse does this already. And of course Photomatix have a plugin available for Lightroom. This essentially amounts to pixel editing, which is beyond the range of Lightroom's metadata editing.

  • Transforming xml file with different elements into HTML

    hi all !
    i have an xml object that has been generated from database using java. the xml file has numerous elements that have been merged into single file. all elements have been got from different table :-
    <?xml version = '1.0' ?>
    <ROWSET>
    <ROW id= "1">
    <EMPID>1</EMPID>
    <EMPADDRESS>H 3 STREET 4</EMPADDRESS>
    <EMPPHONE>98764653</EMPPHONE>
    </ROW>
    <ROW id="2">
    <EMPID>5</EMPID>
    <EMPQUAL>GRADE 12</EMPQUAL>
    <EMPGRADE>A</EMPGRADE>
    </ROW>
    </ROWSET>
    (its just a sample data, might not be wel formed)
    as it shows that each element "ROW" has data corresponding to different employee and with different details. actually these elemnt are the updates in an employee profile that have to be communicated to a distant located database. what i need is a tranformation into HTML so that the recieving user can view this file as html with relative headings of corresponding tables.
    (the schema at both ends is exact replica)
    any help in this regards would be obliging.

    thank you bro!
    the xml file has been created by importing multiple files resulted from XSU into a master file in java. we are running a web based project in a distributed environment. so i would need to make this page appear in a web browser with ACCEPT and REJECT command buttons as the receiver is the approving agent. what all i have thought of so far is to create a style sheet with templates of all heading of each table from where the data is coming from and then run a check on what table the data is from and place that specific heading on the entry. the style sheet would be placed at both ends so only the xml file will be transported and transformation would be done auto.
    i hope it works. but am not sure wether its the right approach or not.

Maybe you are looking for

  • Iphone memory drain due to exchange: help

    For a month a thought I solved this problem, but than it came back. Now I am without solutions and hope some genius here can help me. Three months ago my iphone started with serious problems: - battery life went down from 2 days to 6 hours - apps cra

  • I cant send messages to iphones

    i cant use my imessage to send a message to a friend with and iphone

  • Programmatically selecting one NI-9505 module from a PXI R-series expansion slots

    How can I change the SoftMotion example entitled "position control closed loop- NI 9505.lvproj"  in order to use it as a configurable sub-vi to drive serveral motors? in a PXI-RT box I'm using a PXI-7813R card, its ports are connected to several R-se

  • Search in multiple fields

    I have a form an I want to search in multiple fields of same data block,but with OR condition (not AND condition).How can I do this?

  • Go Recent Folders opens in new window, not the current one

    I noticed with Mavericks, when I use Finder>Go>Recent Folders, it opens a new window instead of changing the contents of the currently open window. Is there a way to get it to work the way it used to? Also, I thought you could open folders in new tab