@@ -60,7 +60,8 @@ r20: { | |||
- Added raw links to the commit, commitdiff, and compare pages (issue-319) | |||
- Support intradocument linking in Markdown content using [[WikiLinks]] syntax (issue-324) | |||
- Support Markdown image links relative to the repository root (issue-324) | |||
- Added filesystem write permission check (issue-345) | |||
- Added filesystem write permission check (issue-345) | |||
- Added GO launch parameter for redirecting logging to a rolling, daily log file (issue-348) | |||
- Support rendering confluence, mediawiki, textile, tracwiki, and twiki markup documents | |||
- Added setting to globally disable anonymous pushes in the receive pack | |||
- Added a normalized diffstat display to the commit, commitdiff, and compare pages |
@@ -20,6 +20,7 @@ import java.io.BufferedWriter; | |||
import java.io.File; | |||
import java.io.FileWriter; | |||
import java.io.IOException; | |||
import java.io.InputStream; | |||
import java.io.InputStreamReader; | |||
import java.io.OutputStream; | |||
import java.net.InetAddress; | |||
@@ -33,8 +34,10 @@ import java.text.MessageFormat; | |||
import java.util.ArrayList; | |||
import java.util.Date; | |||
import java.util.List; | |||
import java.util.Properties; | |||
import java.util.Scanner; | |||
import org.apache.log4j.PropertyConfigurator; | |||
import org.eclipse.jetty.ajp.Ajp13SocketConnector; | |||
import org.eclipse.jetty.security.ConstraintMapping; | |||
import org.eclipse.jetty.security.ConstraintSecurityHandler; | |||
@@ -179,6 +182,34 @@ public class GitBlitServer { | |||
settings = new FileSettings(params.settingsfile); | |||
} | |||
} | |||
if (params.dailyLogFile) { | |||
// Configure log4j for daily log file generation | |||
InputStream is = null; | |||
try { | |||
is = getClass().getResourceAsStream("/log4j.properties"); | |||
Properties loggingProperties = new Properties(); | |||
loggingProperties.load(is); | |||
loggingProperties.put("log4j.appender.R.File", new File(baseFolder, "logs/gitblit.log").getAbsolutePath()); | |||
loggingProperties.put("log4j.rootCategory", "INFO, R"); | |||
if (settings.getBoolean(Keys.web.debugMode, false)) { | |||
loggingProperties.put("log4j.logger.com.gitblit", "DEBUG"); | |||
} | |||
PropertyConfigurator.configure(loggingProperties); | |||
} catch (Exception e) { | |||
e.printStackTrace(); | |||
} finally { | |||
try { | |||
is.close(); | |||
} catch (IOException e) { | |||
e.printStackTrace(); | |||
} | |||
} | |||
} | |||
logger = LoggerFactory.getLogger(GitBlitServer.class); | |||
logger.info(Constants.BORDER); | |||
logger.info(" _____ _ _ _ _ _ _"); | |||
@@ -614,6 +645,9 @@ public class GitBlitServer { | |||
@Parameter(names = { "--tempFolder" }, description = "Folder for server to extract built-in webapp") | |||
public String temp = FILESETTINGS.getString(Keys.server.tempFolder, "temp"); | |||
@Parameter(names = { "--dailyLogFile" }, description = "Log to a rolling daily log file INSTEAD of stdout.") | |||
public Boolean dailyLogFile = false; | |||
/* | |||
* GIT Servlet Parameters | |||
*/ |
@@ -49,9 +49,9 @@ log4j.appender.S.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} [%-5p] %m%n | |||
log4j.appender.R = org.apache.log4j.DailyRollingFileAppender | |||
log4j.appender.R.File = logs/gitblit.log | |||
log4j.appender.R.Append = true | |||
log4j.appender.R.DatePattern = '.'yyy-MM-dd | |||
log4j.appender.R.DatePattern = '.'yyyy-MM-dd | |||
log4j.appender.R.layout = org.apache.log4j.PatternLayout | |||
log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c-30{1} [%-5p] %m%n | |||
log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} [%-5p] %m%n | |||
#------------------------------------------------------------------------------ | |||
# |
@@ -124,6 +124,7 @@ Command-Line parameters override the values in `gitblit.properties` at runtime. | |||
--alias Alias in keystore of SSL cert to use for https serving | |||
--storePassword Password for SSL (https) keystore. | |||
--shutdownPort Port for Shutdown Monitor to listen on. (port <= 0 will disable this monitor) | |||
--dailyLogFile Redirect logging to a rolling, daily log file instead of stdout | |||
--tempFolder Folder for server to extract built-in webapp | |||
**Example** | |||
@@ -135,6 +136,6 @@ Command-Line parameters override the values in `gitblit.properties` at runtime. | |||
You can override Gitblit GO's default Log4j configuration with a command-line parameter to the JVM. | |||
java -Dlog4j.configuration=file:///home/james/log4j.properties -jar gitblit.jar <optional_gitblit_args> | |||
For reference, here is [Gitblit's default Log4j configuration](https://github.com/gitblit/gitblit/blob/master/src/log4j.properties). It includes some file appenders that are disabled by default. | |||
You can not use override the default log4j configuration *AND* specify the `--dailyLogFile` parameter. For reference, here is [Gitblit's default Log4j configuration](https://github.com/gitblit/gitblit/blob/master/src/log4j.properties). It includes some file appenders that are disabled by default. | |||