A small note for IntelliJ users. The '-Dlog4j.configurationFile' in VM options in the Unit Test dialog will be overwritten by the surefire argLine parameters by default (without asking :( ). To avoid this, you need to uncheck the 'argLine' box under Preferences -> Build, Execution, Deployment -> Build Tools -> Maven -> Running Tests. Or you can simply change the content of 'asterix-app/src/test/resources/log4j2-test.xml' for debugging purpose. :)
Best, Xikui On Thu, Dec 21, 2017 at 12:32 PM, Taewoo Kim <[email protected]> wrote: > Update: > > Murthada's method works like a charm. For those folks who want to see > Algebricks optimization details (before and after), the following is what > you need to add in <loggers> section of log4j2-test.xml file. Please note > that the name is "org.apache.hyracks.algebricks", not > "org.apache.hyracks.algebricks.level". Thanks again @Murthada. > > <Logger name="org.apache.hyracks.algebricks" level="DEBUG"> > > <AppenderRef ref="Console"/> > > </Logger> > > > > Best, > Taewoo > > On Wed, Dec 20, 2017 at 5:22 PM, Taewoo Kim <[email protected]> wrote: > > > @Murtadha: forgot to reply. Thank you so much! > > > > Best, > > Taewoo > > > > On Tue, Dec 19, 2017 at 11:53 PM, Murtadha Hubail <[email protected]> > > wrote: > > > >> Hi Taewoo, > >> > >> The new argument to set is -Dlog4j.configurationFile and you need to > >> provide a log4j2 compatible configuration file. It is more or less > similar > >> to logging.properties. > >> You can check [1] for more details about the configuration. We already > >> have a configuration file that you can use and modify under > >> asterix-app/src/test/resources/log4j2-test.xml. Changing the > >> configuration there should reflect the changes > >> on the tests. One thing to note is that log4j2 log levels are different > >> than java logging. You can check [2] for the mapping between the old and > >> the new levels. > >> > >> Cheers, > >> Murtadha > >> > >> [1] https://logging.apache.org/log4j/2.0/manual/configuration.html > >> [2] https://logging.apache.org/log4j/2.0/log4j-jul/index.html > >> > >> On 12/20/2017, 10:38 AM, "Taewoo Kim" <[email protected]> wrote: > >> > >> Hello All, > >> > >> Not long time ago, for each test suite (e.g., OptimizerTest), we can > >> provide a custom log level property file (logging.properties) as a > VM > >> option > >> (e.g., -Djava.util.logging.config.file=/.../asterixdb/asterixdb/ast > >> erix-app/src/test/resources/logging.properties) > >> and customize logging level for each phase (Hyracks, Algebricks, and > >> so > >> on). For example, if I set "org.apache.hyracks.algebricks.level = > >> FINE", > >> then only logging level for Algebricks is changed to FINE. It seems > >> that > >> this method doesn't work anymore. Could somebody tell me how we > could > >> set a > >> custom logging level for each phase? Thanks! > >> > >> Best, > >> Taewoo > >> > >> > >> > >> > > >
