Enabling log4j for a single class or package
hi all
If i use log4j for logging in my classes,
is there a way for enabling it just for a single class or a packages?
Considers that i use log4j.properties for configure it
Regards
Giovanni
Two things. Firstly, it's better to use private static final Object classLock = new Object();because that saves you worrying about whether any other code synchronises on it. Secondly, if you do decide to go for the delegation route then java.lang.reflect.Proxy may be a good way forward.
Similar Messages
-
Is the whole jar loaded for a single class?
Hi,
Hopefully this is an easy yes/no question.
If my application makes reference to only a single class in a jar that has many other classes, does the entire jar (all the other classes) get loaded into memory?
If so, then it's worth it to break the jars up into only those classes I need (they're third party jars). Otherwise, I'll have to look for some other solution.
TIA.
MikeNo you don't.Yes he does - he was big enough to admit it - can't you?
import xyz.* doesn't "load everything in memory" as
schapel stated. You better read chapter 1 of your book
again (and again until it sinks in) before answering
advanced forum's questions.Perhaps you should reread schapel's post before making hot-headed replies to the advanced forum's questions. Besides, you must not read these forums too much because this topic comes up a lot. -
How to enable cookies for a single web page or site?
How do I enable cookies for just one site or web page, without enabling cookies for ever site?
They should be enabled out-of-the-box, but it's worth checking.
Gingerbread: Menu > More > Settings > "Privacy & Security" section
On newer versions of Android, the menu may be organized differently, but hopefully you can still find Settings. -
How to enable https for a single webapp in tomcat 5.5 ?
Hi ,
I want to enable https for my web app in Tomcat 5.5(with JDK 1.5, in WinXP) without affecting other webapps running in the same server . Any idea how to do it ? Pl. note , I dont want to make the entire tomcat as SSL enabled.
Regards
DianaYou specify SSL in web.xml of your application. So, in that case other web applications in same server would not be affected.
<security-constraint>
<web-resource-collection>
<web-resource-name>myresources</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>Following link will help you to setup SSL in tomcat:
[http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/|http://techtracer.com/2007/09/12/setting-up-ssl-on-tomcat-in-3-easy-steps/]
Thanks,
Mrityunjoy -
ClassNotFoundException for a single class in my project... HELP!
Hey all,
I hope someone has an answer to my problem because I wasted enough time trying to figure it myself and, admittedly, I have no idea what I'm doing.
So I have two projects in Eclipse. One project contains a bunch of data access objects (DAO) -- my data access layer -- and the other project is a tool which uses the DAOs to perform some operations. So everything was going hunky-dory until I made an instance of this one DAO class in my tool. When I tried running it, I got a ClassNotFoundException being thrown from the constructor invocation (i.e., new DAO()). It didn't execute the constructor, it just went straight into the exception code. This makes no sense to me because every other DAO class I'm using in my tool works just fine.
I've tried cleaning my projects out and rebuilding to no avail. I've also deleted them from my workspace and checked them out from my CVS server, again to no avail. Does anyone know why this one DAO is not visible to my tool?! Why it can't find it?!
I'm willing to try anyone's suggestion at this point, so please help! I'd appreciate it. Thanks!This makes no sense to meWhat you are dealing with here is a classpath issue. At compile time, apparently whatever DAO class you need is available and the compiler has nothing to complain. When the application is executed however, the DAO class is no longer in the classpath.
So how is your DAO project built? If it is a jar (if it is not, it should be), then that jar is not in the classpath of your tool while it is being executed. Most likely you need to add the jar as a library to the project of your tool for it to work. -
How can I make server use single class loader for several applications
I have several web/ejb applications. These applications use some common libraries and should share instances of classes from those libraries.
But applications are being deployed independently thus packaging all them to EAR is not acceptable.
I suppose the problem is that each application uses separate class loader.
How can I make AS use single class loader for a set of applications?
Different applications depend on different libraries so I need a way that will not share library for all applications on the domain but only for some exact applications.
When I placed common jar to *%domain%/lib* - all works. But that jar is shared between all applications on the domain.
When I tried to place common jar to *%domain%/lib/applibs* and specified --libraries* attribute on deploying I got exception
java.lang.ClassCastException: a.FirstDao cannot be cast to a.FirstDaoHere http://download.oracle.com/docs/cd/E19879-01/820-4336/6nfqd2b1t/index.html I read:
If multiple applications or modules refer to the same libraries, classes in those libraries are automatically shared.
This can reduce the memory footprint and allow sharing of static information.Does it mean that classes should be able to be casted ?You didn't specify which version of the application server you are using, but the config is similar as long as you know what to look for. Basically, you need to change the classloader delegation. Here's how it is done in 8.2
http://download.oracle.com/docs/cd/E19830-01/819-4721/beagb/index.html -
How to change the package name for a msg class
Can anybody tell me how to change the package name for a message class.
and how will it effect in the rerport?
thanks in advance
kp>>and how will it effect in the report?
You wouldn't see any direct effect on the Report.. But if you transport the report to QA & leave the Message class in Dev, it might result in syntax issues & you will not be able to execute the report. Just ensure that both of them get transported to QA & you will be fine.
~Suresh -
Revision: 3403
Author: [email protected]
Date: 2008-09-29 12:36:37 -0700 (Mon, 29 Sep 2008)
Log Message:
Fix for SDK-17097 - Missing summary description of a class in package classes table
QA: Yes
Doc:
Tests: checkintests
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-17097
Modified Paths:
flex/sdk/trunk/asdoc/templates/class-files.xsltWell, it's kind of logical that as you put more jar files (classes) in Tomcat, it changes the error to ask for the classes (inside a jar) it cannot find.
There was a good class->jar finder on the internet some years ago, but i don't remember the address. Try looking for that and search all the missing classes (NotDefined) and their correspondig jar files.
Good Luck! -
I want Photoshop and InDesign- If I buy two "single app" subscriptions it is $40/month but if I buy the single app subscription for InDesign and the Photography package it is $30/month. Am I missing something? Are these different versions of Photoshop?
Hi,
No it's the same Photoshop .Photography program is just a temporary promotion pack with Photoshop and Lightroom and it can end anytime .So you can buy Indesign and photography to have Indesign,Photoshop and Lightroom .
Regards, -
Revision: 15779
Revision: 15779
Author: [email protected]
Date: 2010-04-27 20:19:48 -0700 (Tue, 27 Apr 2010)
Log Message:
Package and class level javadoc for the flex2.compiler.mxml package
and subpackages.
QE notes:
Doc notes:
Bugs:
Reviewer: Corey (post commit)
Tests run: checkintests
Is noteworthy for integration: NO
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/AbstractGenerator.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceGenerator.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InvalidStateAttributeUsage.j ava
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InvalidStateSpecificValue.ja va
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/MXMLNamespaces.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/MxmlCompiler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/analyzer/HTTPServiceAnalyzer .java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/analyzer/RemoteObjectAnalyze r.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/analyzer/SyntaxAnalyzer.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/analyzer/WebServiceAnalyzer. java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AbstractBuilder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AnonymousObjectGraph Builder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ArrayBuilder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.jav a
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/DocumentBuilder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/HTTPServiceBuilder.j ava
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/InlineComponentBuild er.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ModelBuilder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/PrimitiveBuilder.jav a
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/RemoteObjectBuilder. java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ServiceRequestBuilde r.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/VectorBuilder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/WebServiceBuilder.ja va
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/XMLBuilder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/XMLListBuilder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/Analyzer.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/AnalyzerAdapter.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/ArgumentsNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/ArrayNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/BindingNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/BooleanNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/CDATANode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/ClassNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/DeclarationsNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/DefinitionNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/DesignLayerNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/DocumentNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/FunctionNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/HTTPServiceNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/InlineComponentNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/IntNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/LayeredNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/LibraryNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/MetaDataNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/MethodNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/ModelNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/Node.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/NumberNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/OperationNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/PrimitiveNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/PrivateNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/RemoteObjectNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/ReparentNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/RequestNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/ScriptNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/StateNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/StringNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/StyleNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/SyntaxTreeBuilder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/UIntNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/VectorNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/WebServiceNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/XMLListNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/XMLNode.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/XercesClassLoader.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/CodeFragmentList.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/DescriptorGenerator.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/StatesGenerator.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/TextGen.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/VelocityUtil.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/AttributeHandler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/BindingHandler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/ChildNodeHandler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/DeclarationHandler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/FrameworkDefs.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/NodeTypeResolver.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/TextParser.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/TypeCompatibility.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/ValueNodeHandler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Assignable.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Deprecated.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/DynamicProperty.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Effect.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/ElementTypeNotFound. java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Event.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Inspectable.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Property.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Style.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Type.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/TypeTable.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/Array.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/BindingExpression.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/DocumentInfo.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/EventHandler.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/LineNumberMapped.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/Method.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/Model.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MovieClip.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/Operation.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/StatesModel.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/VariableDeclaration.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/Vector.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/decl/InitializedProperty Declaration.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/decl/PropertyDeclaration .java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/decl/UninitializedProper tyDeclaration.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/ArrayElementInitial izer.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/DynamicPropertyInit ializer.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/EffectInitializer.j ava
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/EventInitializer.ja va
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/Initializer.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/NamedInitializer.ja va
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/StaticPropertyIniti alizer.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/StyleInitializer.ja va
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/ValueInitializer.ja va
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/VisualChildInitiali zer.java
Added Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/analyzer/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/decl/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/package.html
Removed Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/reflect/Parameter.java -
Revision: 15741
Revision: 15741
Author: [email protected]
Date: 2010-04-26 22:43:03 -0700 (Mon, 26 Apr 2010)
Log Message:
Package and class level Javadoc for the flex2.compiler.media package.
QE notes:
Doc notes:
Bugs:
Reviewer: Corey (post-commit)
Tests run: checkintests
Is noteworthy for integration: NO
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/AbstractTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/DataTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/FontTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/ImageTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/JPEGTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/LosslessImageTranscoder.jav a
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/MovieTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/SVGTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/SkinTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/SoundTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/XMLTranscoder.java
Added Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/package.html -
I pay for CC single app; I used to have CS6 or CS7 - Single app membership as well. I would like to take advantage of the 29.99 Complete package. Is that available to me?
Hi Scott,
The discounted price doesn't seem available to me. In my account, I
selected upgrade to Complete and it asks for $599 US. I believe I qualify
for the $29.99 per month.
What do we do?
Thanks,
Andrew -
Hi there,
I am just wondering what is the best way for me to do this - If i can qualify for the reduced rate complete package then this may be better value but I'm not sure if I do!Hi Charlie,
You can go for the Photography plan which includes both Photoshop and Lightroom as a bundle and it will cost you $9.99 a month.
Creative Cloud Photography plan | Adobe Creative Cloud
Thanks,
Nikhil Gupta -
We have used the Dragon Dictate add on for the past 4 months with no problem (the last 2 versions of Firefox I believe). Now since the new version launched this morning, there is pop-up warning for every single website visited - "Allow www.xxxx.com to run Dragon Dictate Internet" along with a 'Continue Blocking' or 'Allow' button. Why is this here since it was not present before? Surely there must be a global setting where I can switch this off rather than have to click a button and choose 'Allow' for every single website we go to?? Or is this something that Dragon has to fix in how it deals with the new version of Firefox?
You are a genius.
Why didn't I see that Tab?? Lack of sleep certainly does make one blind..
many thanks -
Hi,
I have a struts application and I need to implement a logger for it. I would like to use Log4j but am having problems initializing it.
Because I am using struts, I do no have access to the Action servlet and so cannot place the intiializing code in the servlets init() method.
Is there a way of using the struts-confix.xml file to enable Log4j logging ?
Basically I need the application to load up the log4j.properties file using
PropertyConfiguratior.configure("log4j.properties");
But how do I do this in Struts ??
thanks
PaulStruts core library uses commons logging , some drop log4j.properties files /WEB-INFO/classes, cooomons lgging will pick up and initialize.
Other way is write a plug-in and load the log4j configuration
==============================================
1. Add plug in to struts-config files like validator plug in
<plug-in className="com.tests.utl.Log4jPlugin">
<set-property
property="log4jconfig"
value="/WEB-INF/log4j.xml"/>
</plug-in>
2. Drop log4j.xml file in "/WEB-INFO" folder
3. Sample "log4j" plug in java class, here key is define property "log4jconfig" as plugin setter/getter, struts will set the value read from struts-config.
================================
public class Log4jPlugin implements PlugIn {
private String log4jconfig;
public Log4jPlugin() {
public void destroy() {
System.out.println("Destroying Hello World PlugIn");
public void init(ActionServlet servlet, ModuleConfig config)
throws ServletException {
URL url =null;
try {
url = servlet.getServletContext().getResource(log4jconffile);
System.out.println(" url " + url);
} catch (MalformedURLException ex) {
ex.printStackTrace();
DOMConfigurator.configure(url);
public String getLog4jconfig() {
return log4jconfig;
public void setLog4jconfig(String log4jconfig) {
this.log4jconfig = log4jconfig;
}
Maybe you are looking for
-
PLEASE HELP! Hooking up WRT54G2 to a Verizon GT704-WG
I have searched here and google, no luck. Here is what I am trying to do. I have Verizon DSL in a two story house, Verizon only issues and uses one modem/router (Actiontec GT704-WG). I have no houses near me within 1500 feet. It is a wireless router
-
How do you change Apple ID from previous provider
V
-
It seems to crash after a period of time and then will keep crashing constantly if I keep trying to open up Firefox. It does the same with Safari. It's a mac running on 10.5.8. Is it possible to download and use older versions of Firefox? Help! Pleas
-
The N86 uses its micro USB port as the main point chraging but, for some reason, only accepts from the included charger or when the included USB cable is connected to a PC. I bought an external USB battery from Amazon that I used during travel to cha
-
Update of Extension Manager CC failed
Is anyone else having this problem with Extension Manager CC update through Creative Cloud? It fails to update on all attempts and retries?