Which approach is good?

I don;t know if I am posting this on the right forum. So Please....
The question is with respect to logging.
I know using the log4j , we can configure/direct the logs based on the package names.
Now I have one package and in the same package, In every class, I have to normal log and also do audit log. And now the audit log should go to db.
Now I have three proposals, I want you to tell me which one is better and why
Case 1)
Create a class called AdminLogger and have a static method "log" which would do log the message to the DB.
Q) If I use static method, I believe I need to put synchronized key word to the "log" method ?. Because, it might be called from different places. And more over there is a possibility that several users may be invoking the objects.
case 2)
Create a class called AdminLogger with no public constructor and have a method called getLogger which would return a new instance every time and call log method on the instance
Q) Pretty much it creates a new instance of AdminLogger for every log.
case 3) Have one static instance for each class like
public static AuditLogger logger = new AuditLogger();
Q) This would create n instances for n classes. and they will be in memory all the time.
thanks

Log4j is thread safety you do not have to synchronize your static methods.
Regards,
Sławomir Wojtasiak

Similar Messages

  • I have a iPad and a iPod touch how do I sync both of them to iTunes without mixing the apps, my iPad apps shows up on my iPod which is not good because I only have 8G on the iPod, I would like to keep them separate

    I have a iPad and a iPod touch how do I sync both of them to iTunes without mixing the apps, my iPad apps shows up on my iPod which is not good because I only have 8G on the iPod, I would like to keep them separate

    Turn Automatic Download off
    Settings>iTunes and Apps Store>Automatic Download>Off

  • I have been buying apps for a long time  without a problem using my credit card on file. All of a sudden itunes is not recognizing my card which is in good standing. All the info is correct but itunes/apple says it doesn't  match the bank info. Any ideas

    I have been buying apps for a long time  without a problem using my credit card on file. All of a sudden itunes is not recognizing my card which is in good standing. All the info is correct but itunes/apple says it doesn't  match the bank info. Any ideas?

    Answered in your Other post on this Topic...
    https://discussions.apple.com/message/24053626#24053626

  • Guide me as a developer of iOS and also and active online game player of games like PWI, which macBook is good for me pro or air or other if any ?

    Hi,
    I am now to macBooks and dont know which one is good for me.
    Please guide me which one I have to buy.
    Regards,
    Aalok Parikh
    From India

    The retina display MacBook Pros are very lightweight, so you won't really notice a weight difference between a 15" or 13" one. If you can afford it, get the 15" notebook.
    Purchase the most powerful configuration you can afford.  If you can afford it, get the larger SSD - but, you can always get a portable external hard drive that you can take with you if you find the internal drive is too small.
    ~Lyssa

  • We have many mappings, which one is good in performance wise ?

    We have many mappings, which one is good in performance wise ?

    HI
    Different Mapping Techniques are available in XI. They are: Message Mapping, XSLT Mapping, Java Mapping and ABAP mapping.
    u2022The integration repository includes a graphical mapping editor. It includes built-in functions for value transformations and queue and context handling.  There is an interface for writing user-defined functions (java) as well.
    u2022XSLT mappings can be imported into the Integration Repository; java methods can be called from within the XSLT style sheet. Advantages of this mapping are: open standard, portable, extensible via Java user-defined functions.
    u2022If the transformation is very complex, it may be easiest to leverage the power of Java for mapping.
    u2022ABAP mapping programs can also be written to transform the message structures.
    Message Mapping
    SAP XI provides a graphical mapping tool that generates a java mapping program to be called at run time.
    u2022Graphically define mapping rules between source and target message types.
    u2022Queue-based model allows for handling of extremely large documents.
    u2022Drag-and-drop.
    u2022Generates internal Java Code.
    u2022Built-in and user-defined functions (in Java)
    u2022Integrated testing tool.
    u2022N:M mapping is possible.
    JAVA MAPPING:
    Usually Java mapping is preferred when the target structure is relatively complex and the transformation cannot be accomplished by simple graphical mapping.
    For e.g. consider a simple File->IDoc scenarion where the source file is a simple XML file, whereas the target file is an IDoc with more than one hierarchy level e.g FINSTA01. Content conversion in XI can only create a single level hierarchy, so in this scenario a Java mapping would come in handy.
    See these:
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs
    When to use Java mapping
    1) Java mapping are used when graphical mapping cannot help you.
    Advantages of Java Mapping
    1)you can use Java APIs and Classes in it.
    2) file look up or a DB lookup is possible
    3) DOM is easier to use with lots of classes to help you create nodes and elements.
    Java mapping can be used when you have complex mapping structures.
    ABAP MAPPING:
    ABAP mappings are mapping programs in ABAP objects that customers can implement using the ABAP Workbench.
    An ABAP mapping comprises an ABAP class that implements the interface IF_MAPPING in the package SAI_MAPPING. The interface has a method EXECUTE with the some signature.
    Applications can decide themselves in the method EXECUTE how to import and change the source XML document. If you want to use the XSLT processor of SAP Web AS, you can use the ABAP Workbench to develop a stylesheet directly rather than using ABAP mappings.
    In ABAP mapping you can read access message header fields. To do this, an object of type IF_MAPPING_PARAM is transferred to the EXECUTE method. The interface has constants for the names of the available parameters and a method GET, which returns the respective value for the parameter name. The constants are the same as in Java mappings, although the constant MAPPING_TRACE does not exist for ABAP mappings. Instead, the trace object is transferred directly using the parameter TRACE of the method IF_MAPPING~EXECUTE.
    For more details refer
    http://help.sap.com/saphelp_nw70/helpdata/EN/ba/e18b1a0fc14f1faf884ae50cece51b/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    ABAP Mapping
    /people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs
    https://websmp101.sap-ag.de/~sapdownload/011000358700003082332004E/HowToABAPMapping.pdf
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    /people/r.eijpe/blog
    ABAP Mapping Vs Java Mapping.
    Re: Message Mapping of type ABAP Class not being shown
    Re: Performance of mappings (JAVA, XSLT, ABAP)
    XSLT Mapping
    XSLT stands for EXtensible Stylesheet Language Transformations. It is an XML based language for transforming XML documents into any other formats suitable for browser to display, on the basis of set of well-defined rules.
    /people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    The above menotined are the mapping present in the XI.
    When it is critical and complicate we go for the ABAP,JAVA or XSLt mapping. For simple Mapping we go for the graphical mapping.
    the selection of mapping also depends upon the requirement and alos on our scenario.
    cheers

  • I want to buy MBA 11'' which model is good.  i.e.  i need speed.  I am using Lenovo netbook s-10. Is very slow in opening web pages an also in operating other apps.

    I want to buy MBA 11'' which model is good.  i.e.  i need speed.  I am using Lenovo netbook s-10. Is very slow in opening web pages an also in operating other apps.

    Put your first emphasis on memory. Don't even consider 2 GB.
    Second, maximize your SSD size according to the ability of your wallet. Lastly is your processor.
    For what you describe the MBA is plenty fast.

  • HT1689 which ipad is good for Panama att or verizon

    which ipad is good for Panama att or verizon ?

    AT&T by far.
    GSM dominates the overall worldwide market by a significant margin.
    Check AT&T's website for how many GSM network "partners" they have throughout the world compared to Verizon.
    Copied from AT&T's website.
    Stay connected while traveling to more than 220 countries and on more than 140 cruise ships, and access email and the Internet in more than 195 countries.
    I believe Verizon has 35 countries.

  • I have macbook 5.2 and i am using Mac OS 10.5.8 . which one is good for me to upgrade and how to do that..plz help me

    i have macbook 5.2 and i am using Mac OS 10.5.8 . which one is good for me to upgrade and how to do that..plz help me

    You have a 13" Early or Mid 2009 MacBook. Either one can run OS X Mavericks with enough RAM, 2 GB minimum. But first you will need to update to OS X Snow Leopard 10.6.8 so that you have the Mac App Store installed on your MacBook
    Buy this from apple;
    http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard
    Then download and update with this update combo;
    OS X Snow Leopard 10.6.8 v1.1 update combo
    http://support.apple.com/kb/DL1399
    After this you will have the Mac App Store on your MacBook and you should be able to download and install OS X Mavericks for free!
    Your MacBook must meet these minimum tech specs to run Mavericks;
    http://support.apple.com/kb/HT5842

  • Which laptop is good to build sharepoint 2013 environment for personal use ?

    Which laptop is good to build sharepoint
    2013 environment for personal use ?

    HI Chaitu,It depends on what function of development that you want to do.I suggest to have
    a below configuration to work with sharepoint.
    Fast CPU!
    32 GB of RAM (24 GB minimum, but 32 highly recommended)
    500 GB of space
    Please find also in the blog to know more about configurations and the installations.
    http://expertsharepoint.blogspot.de/2014/07/hardware-and-software-requirements-for.html
    Anil Avula[Microsoft Partner,MCP,MCSE,MCSA,MCTS,MCITP,MCSM] See Me At: http://expertsharepoint.blogspot.de/

  • Which method is good

    Hi Experts,
    We can load data from flat file to oracle tables using
    SQL*LOADER
    UTL_FILE
    EXTERNAL TABLES.
    Could you please tell me Out of these three methods which one is good and why?
    Please help me.
    Thanks in advance.

    I agree with Billy, but here's a response anyway hehe!...
    SQL*Loader... great for loading files from a client machine, but then you should question why you have data stored on client machines. ;) Also, can only be used from the command line (or a command line call from a scheduled job)
    UTL_FILE... great for reading/writing files on a server, but just basic processing of line or bytewise data, not concept of structure included. Can only be used from within PL/SQL code.
    External Tables... greate for reading writing structured files on the server, including all the SQL*Loader functionality, and the ability to easily change it to read from multiple files and change filenames if necessary through code. Has the added benefit the data can be treated directly as a table of data and used straight away in SQL statements, and the data can be changed at the file level as required and will be picked up at the next query of it. Being able to use it in SQL also means it's easily available in PL/SQL code too.
    Me personally, External tables are always the first option.

  • Which approach do you prefer for upgrade

    When upgrade 9.2 to 10.1 or 10.1 upgrade 10.2, which approach do you prefer, DBUA, manual ipgrade, export/import or data copying? Oracle document suggests to use DBUA, but from your experience, does it convince and why?
    Thank you for sharing,

    For me, It depends of the database size and business constraints.
    If the DB is small I'd probably use export/import, because it gives me the opportunity to make a very clean move, and use new features like LMT, or ASM.
    If time is a constraint and the DB is big I'd run DBUA. but remember that DBUA also has limitation, for example you will net be able to upgrade an Oracle DB 7.X to 10G using DBUA.
    Hope this helps,

  • How can we find delivery documents which are not goods issued?

    Hi All,
    How can we find delivery documents which are not goods issued?
    Thanks in advance

    hi,
    please check in VL06O.
    there will be plenty of options on the same.
    you are requested togo for push button FOR GOODS ISSUE from there u will go to VL06G only
    your requrient will be satisfied.
    regards,
    balajia
    Edited by: balaji timmampalli achari on Nov 11, 2010 12:39 PM
    Edited by: balaji timmampalli achari on Nov 11, 2010 12:40 PM

  • As a private , just study Photoshop programe with Creative Cloud,, which program is good?

    hello ,
    i'm Korean and Programmer.. i also want to study photoshop..
    with Creative Cloud program.. as a personnel ,  there are several program... just beginner as a new, which program is good for me.. and
    if install  one pc, can't change  another pc like notebook..?

    hello ,
    i'm Korean and Programmer.. i also want to study photoshop..
    with Creative Cloud program.. as a personnel ,  there are several program... just beginner as a new, which program is good for me.. and
    if install  one pc, can't change  another pc like notebook..?

  • As a abaper which module is good to give support

    hi gurus,
    As a abaper which module is good to give support.I got a job as a fresher,Now in my company the training will be started on all modules,our technical Head told us choose the modules like support(HR,MM,PP,FICO).so which module is better ,i dont have any idea about it.Pls suggest me.
    Thanks & Regards,

    hi,
    there is nothing like only one is good because all the modules are integrated so we need to know all.
    in ur case better go with the one on which u dont have much knowledge becse u can learn new subject.
    anyways u will get knowledge on all with experience.
    all the best.

  • Which DVD are good  for burning

    I tried many different dvd/cd for burning movies and music, but they are not all working very well.
    Does somebody knows which dvd are good for burning movies and music.

    Hi Sue,
    Thanks for your answer. I bought them also before, but it seems that not all working very good.
    I burned dvd's and play them on my Home theather. Beginning good, later it gave reading problems. What I also know is: Dvd players from 40 euro's works better then one from 1600 euro's.
    I shall buy the -R this week and hopefully the work better.
    Ray

Maybe you are looking for

  • Report Viewer and Multiple Data Sources

    I know that it is possible to create a report in Crystal Reports using multiple data sources.  But is it possible to use just the Free  Report Viewer to view a report with Multiple Data Sources? Our company uses Crystal Reports XI.  I do not use the

  • How to set up a basic file sharing server for my small architectural business?

    I have no idea if I have posted in the correct area as this is my first forum post within the apple support community! I have been using a 21.5" imac running 10.6.8 for the past 5 years to run my small home based architectural design business. I have

  • BT Infinity Broadband - stay away. Extremely poor...

    Just switched to BT Infinity broadband. Unfortunately, I took the limited option as we do not download a lot but wanted the faster speeds. A big mistake. Regret going to BT. Issues that we have faced so far: 1) Installation could not be done on the f

  • Error restarting OBIEE services after deploying a RPD.

    Hi all, I have recently performed OBIEE installation and, when a repository is deployed and all services restarted comes an error like this one and BI Server status is down: Operation Failed: start; OracleInstance: instance1; Component: coreapplicati

  • Setting default home page for managed computers

    We are currently running Mac OS X Leopard Server, which manages 22 other machines in a school environment. We also have a wiki/blog/webmail page setup at the address artroom.local and we want this to be the homepage on every managed machine in the ro