There are 2 log4j.properties files in my classpath. I need both of them. One of them is necessary for the library that I use, and the other for my code. When I run my jar file, it can read the properties used by the library, but it does not read my own properties file. How can I get it to read my log4j without using the PropertytConfigurator in all of my source files? Is there a way to configure it so that it uses both properties files together?
To answer your first question, you can point it to your own file by specifying its unique name and adding the following system property when the application starts.
-Dlog4j.configuration=path_to_my_properties_file
, 2 , .
log4j.properties, , ( ).
log4j.properties
( ?) .properties .
.properties
All entries go to one properties file. Inside this file, you can distinguish between your own classes and the library logging configuration.
Source: https://habr.com/ru/post/1789303/More articles:Drawing particles with a processor instead of a graphics processor (XNA) - xnaWhere does nativeGetUninitializedObject really exist? - c #How to programmatically set django select box? - djangoCan I use C ++ functions in Visual Basic? - c ++ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ WPF Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΈΡ ΡΠ°Π·Π»ΠΈΡΠ½ΡΡ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ MEF - c#Delphi ADO: need to clear the parameters? - delphiIE7 CSS issue with overlapping divs - cssHiding or Moving SegmentContoller - iphonerails - ActiveSupport :: SecureRandom.hex - Get the number of characters SET - ruby-on-railsHow to calculate the weighted means of the vector within the levels of factors? - rAll Articles