I am trying to modify log4j.properties so all debugging from scriptrunner addon can be redirected to a separate file , not in atlassian-jira.log.
I have tried this, but no groovy.log is created under
log
subdirectory of the JIRA HOME directory:
log4j.appender.GroovyLog=com.atlassian.jira.logging.JiraHomeAppender
log4j.appender.GroovyLog.File=groovy.log
log4j.appender.GroovyLog.MaxFileSize=20480KB
log4j.appender.GroovyLog.MaxBackupIndex=5
log4j.appender.GroovyLog.layout=org.apache.log4j.PatternLayout
log4j.appender.GroovyLog.layout.ConversionPattern=%d %t %p [%c{4}] %m%n
log4j.appender.GroovyLog.Threshold=DEBUG
log4j.category.com.onresolve.jira.groovy = DEBUG, console, GroovyLog
log4j.additivity.com.onresolve.jira.groovy = false
If instead I replace the first 2 lines for this:
log4j.appender.GroovyLog=org.apache.log4j.RollingFileAppender
log4j.appender.GroovyLog.File=${catalina.home}/logs/groovy.log
It does create groovy.log under the logs subdirectory of the JIRA INSTALLATION directory.
I need groovy.log to be where all application logs are in the log subdirectory of the JIRA HOME directory.
Thanks in advance,
Hi Adolfo,
I understand you are looking to have scriptrunner create its logs in the $JiraHome/log/ folder instead of the default here in the $JiraInstall/logs/ folder.
The way this could be done would be to create a new variable for the Jira home directory. By default the setup and installation of Jira doesn't always require Jira installations set this variable manually. Most times it is not set explicitly, but you can follow How do I set my JIRA home? in order to create an operating system variable called JIRA_HOME.
The 3rd bullet point on that page has these instructions on how to do this. Depending on whether this is a Windows vs Linux system the steps on how do to this are slightly different. But either way you can define this to the specific path of your JIRAHOME path and then at that point you can use the $JIRA_HOME/log path in your script as a means to log files there.
Set an environment variable named
JIRA_HOME
in your operating system whose value is the location of your JIRA home directory. To do this:
- On Windows, do one of the following:
- Configure this environment variable through the Windows user interface (typically through 'My Computer' or 'Computer')
- At the command prompt, enter the following command (with your own JIRA Home path) before running JIRA from the command prompt:
set JIRA_HOME=X:\path\to\JIRA\Home
Please set yourJIRA_HOME
environment variable value using this format, where:
X
is the drive letter where your JIRA Home Directory is located and- no spacing has been added around the equal sign ('
=
')- Specify the command above in a batch file used to start JIRA.
- On Linux/Solaris, do one of the following:
- Enter the following command at a shell/console prompt (with your own JIRA Home path) before running JIRA:
export JIRA_HOME=/path/to/jira/home
- Specify the command above in a script used to start JIRA.
I hope this helps.
Andy
Hi Andrew,
Finally I got it wot work. Using JIRA_HOME didn't work for me, but this does:
log4j.appender.GroovyLog.File=${jira.home}/log/groovy.log
I set JIRA_HOME but log4j didn't translate it to the actual directory. On the other hand I noticed jira.home is set within the jira startup script, so I used that instead and work OK.
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Team,
I want to create log file on sftp server. how to achieve that?
How to configure log4j.properties file for that?
Thanks in advance!!
Regards,
Parikshit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the Atlassian Community!
Log4j does not have a way to ftp logs to a remote server. You will need to script something to do that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
I'm using JSch for communicating to sftp server where I'm providing server Ip address, username, password, and port while I've also used SFTPAppender in my log4j.properties file.
Still not able to create log file on sftp server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will need to go through the SFTPAppender documentation, this is not an Atlassian question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any workaround for creating log file on sftp server through scriptrunner for jira data center
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.