Location of Pentaho 5 log config - log4j

I'm trying to connect Pentaho 5.4 (kitchen job runs to be precise) to our Logstash Server. To do that, I need to edit the Log4j config file so it will use the new appender.
I searched every jar file and every folder, but to no avail. Pentaho 6 comes with several log4j.xml files, but none of them seems to be used for the output, either. Also, the -Dlog4j.debug flag does not give me useful any info. Am I barking at the wrong tree?
A typical log looks like this:
Kitchen.bat -Dlog4j.debug /file "samples\jobs\changelog\Process changelog.kjb"
..
2016/04/14 15:24:17 - Kitchen - Start of run.
2016/04/14 15:24:18 - Process changelog - Start of job execution
..
2016/04/14 15:24:21 - General - Change log processing 2 - Finished processing (I=0, ... E=0)
Any help is greatly appreciated!

Related

flyway commandline, How to log the messages in a log file during migration

This question is regarding the "logging the messages in a log file, while migrating through flyway command line". I went through the below links in StackOverflow, and followed the steps mentioned, but couldn't get the list of steps to follow to see the messages in log file.
How configure logging for Flyway command line
Flyway logging with log4j?
Flyway logging with Logback
I have placed log4j-1.2.17.jar, logback-classic-1.1.7.jar, logback-core-1.1.7.jar and slf4j-api-1.7.21.jar under flyway/lib folder and placed the logback.xml in conf location (also tried moving out of conf location too).
Lib is mentioned in the classpath in flyway and flyway.cmd files.
But I always see the debug messages on stdout, and no log file is being created.
Flyway version 4.2.0
Could someone share the list of steps, to write the log messages on a log file during migration/info.
While keeping logback.xml inside conf directory, You need to edit flyway/flyway.cmd based on your environment.
Replace line CP="$INSTALLDIR/lib/*:$INSTALLDIR/drivers/*"
with
CP="$INSTALLDIR/conf:$INSTALLDIR/lib/*:$INSTALLDIR/drivers/*"
Replace line
%JAVA_CMD% -cp "%INSTALLDIR%\lib\*;%INSTALLDIR%\drivers\*" org.flywaydb.commandline.Main %*
with
%JAVA_CMD% -cp "%INSTALLDIR%\conf:%INSTALLDIR%\lib\*;%INSTALLDIR%\drivers\*" org.flywaydb.commandline.Main %*
Explanation:
conf directory is not declared as classpath in the execution scripts. So need to add it in classpath so that logback.xml can be read from classpath.
anywhere you put the logback.xml file, it has to be declared as classpath.

Logstash 5 configure log4j logging for itself (not as plugin)

This is just for future reference since I solved it myself.
When I switched from logstash 2.x to 5.x, I was dealing with this warning (when I was runnig my logstash on this path D:\somepath\logstash-5.0.1):
Could not find log4j2 configuration at path /somepath/logstash-5.0.1/config/log4j2.properties. Using default config which logs to console
After some searching on internet and digging in ruby code (in the extracted logstash) I have found out this:
necessary to use path.settings (as mentioned many times) correctly
use correctly file or directory as URL path.
Finally I run my logstash as:
logstash.bat --path.settings=file://D:/somepath/logstash-5.0.1/config

Cruisecontrol.net with UCM Clearcase - How to?

I am trying to configure Cruisecontrol.net for UCM Clearcase for the first time. Following is the sourceControl tag in the ccnet.config file:
<sourcecontrol type="clearCase">
<branch>123_India_Release</branch>
<autoGetSource>true</autoGetSource>
<viewName>admin_123_CRUISE</viewName>
<viewPath>$(ViewDirectory)</viewPath>
<useLabel>false</useLabel>
<useBaseline>false</useBaseline>
<executable>cleartool.exe</executable>
</sourcecontrol>
I constantly receive the following error:
ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control
operation failed: cleartool: Error: Not an object in a vob: "PATH TO
THE VIEW"
When I run cleartool from an arbitrary directory with the following parameters:
cleartool.exe lshist -r -nco -branch "123_India_Release" -since
05-Dec-2012.14:38:18 -fmt
I get the same error. But if I change the working directory to $(ViewDirectory) before running cleartool, it runs fine.
How should I make Cruisecontrol.net run cleartool.exe from the $(ViewDirectory)?
I have already tried adding <workingDirectory>$(ViewDirectory)</workingDirectory> tag before <executable>cleartool.exe</executable> but it did not work.
Any help would be appreciated.
EDIT 1:
As a workaround I have done the following:
<exec>
<executable>cleartool.exe</executable>
<baseDirectory>d:\Workspace\123_India_Release\VOB</baseDirectory>
<buildArgs>update -force</buildArgs>
<buildTimeoutSeconds>6000</buildTimeoutSeconds>
</exec>
I have added this to the tasks tag. I have configured an hourly trigger which does the following:
1) Update snapshot view
2) Build the VS 2010 solutions mentioned in the tasks tag.
The limitations are:
1) The trigger is hourly. I want it to be a commit based trigger.
2) This is a workaround
EDIT 2:
Further experimentation revealed that the ccnet.exe works fine. It does all that is needed. The issue is caused by the service ccservice.
I have stopped ccservice for now and started ccnet.exe. I plan to leave it running.
The View directory isn't enough: you must specify a vob.
See for instance:
"clearfsimport: Error: Not an object in a vob: "\"." (as an illustratio of that error message)
this thread (or this one): "You have to specify explicitly the VOB(s) to check for modification set"
The path should looks like:
<viewPath>Drive:\path\to\view\vobname</viewPath>
If your $(ViewDirectory) already references Drive:\path\to\view, then you could use:
<viewPath>$(ViewDirectory)\vobname</viewPath>

How to configure log4j and Selenium Grid?

When I launch a Grid hub using Ant, the logging is all by default on the console. I would like to know if there is a way wherein I can alter the build.xml file of Selenium Grid and include a log4j logger into it. I understand that I can specify a log file to Ant itself using the -logfile option. But this would cause the log file to be overwritten everytime the grid is launched. I want to ensure that the log files are automatically renamed after a threshold is reached for better maintenance. Any help and if possible some examples on how to do it would be greatly appreciated (I am new to using log4j which is why I am asking for some sample for this specific need).
You need to specify the location of the Log4j archive as well as its configuration file when starting up Selenium. In the following example, I've updated the classpath to load the log4j.hub.properties configuration file located in the /etc/selenium directory and the log4j.jar located in the /usr/lib/selenium directory. I've also setup some additional log files:
java -classpath /etc/selenium:/usr/lib/selenium/log4j.jar:/usr/lib/selenium/selenium-server-standalone.jar -Dlog4j.configuration=log4j.hub.properties org.openqa.grid.selenium.GridLauncher -role hub -log /var/log/selenium/hub.debug.log > /var/log/selenium/hub.output.log 2> /var/log/selenium/hub.error.log &
Then you can have something like the following to achieve what you are looking for:
log4j.rootLogger=ALL, file
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=/var/log/selenium/hub.log
log4j.appender.file.Append=true
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} <%p> <%t> %m%n
You might want to look at this page for more information about how Selenium logging is working.

Loading project-specific log information into log files

I am using Eclipse and I am creating a web project. I am also using SLF4J for storing logs in a log file.
I am putting the log4j.properties file into the WEB-INF/classes folder .
When I access the login page, all of the associated logs and my debug statement log are being loaded into the log file, but I want a specific log (i.e., project specific log) to be loaded into the log file instead of other logs.
On the log file I can see:
10/20/2010 10:16:24 - DEBUG - org.apache.commons.digester.Digester.sax
.
10/20/2010 10:16:24 - DEBUG - org.apache.commons.digester.Digester - [ObjectCreateRule]{resource-config/resource}New org.ajax4jsf.javascript.AjaxScript
.
10/20/2010 10:16:24 - DEBUG - org.apache.commons.digester.Digester - [ObjectCreateRule]{resource-config/resource}New
.
10/20/2010 10:16:24 - DEBUG - org.apache.commons.digester.Digester.sax
.
10/20/2010 10:16:24 - DEBUG - org.apache.commons.digester.Digester - [ObjectCreateRule]{resource-config/resource}New org.ajax4jsf.javascript.AjaxScript
.
10/20/2010 10:16:24 - DEBUG - org.apache.commons.digester.Digester - [ObjectCreateRule]{resource-config/resource}New
.
Can anyone help me to find out how to store specific project related logs into log file?
Have something like the following in your log4j.properties file:
log4j.logger.com.foo.logingubbins=DEBUG, loginfilelogger
log4j.appender.app=org.apache.log4j.RollingFileAppender
log4j.appender.loginfilelogger.File=c:/logs/login.log
log4j.appender.loginfilelogger.layout=org.apache.log4j.PatternLayout
log4j.appender.loginfilelogger.layout.ConversionPattern=%d [%t] %-5p [%c (%F:%L)] %n \t %m %n
That first line tells the logger to use a new logger for com.foo.logingubbins, which you direct to a separate file. You might want to add an additivity statement in there as well if you want it entirely separated.
The log4j manual can give you some useful examples, though I have to admit that the information on additivity is a little hazy.
Thanks for reply. I added the folowing steps into log4j.properties file
log4j.logger.org.apache.commons.digester=ERROR
log4j.category.se.bilprovningen.prippe=DEBUG,R
Now i am able to store project specific log into log file.
Thanks
Arvind

Resources