Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing name of default logfile #305

Merged
merged 2 commits into from
Jul 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dav/tests/travis/caldav/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onf

RESULT=$?

tail "$/../../../../../data-autotest/owncloud.log"
tail "$/../../../../../data-autotest/nextcloud.log"

exit $RESULT
2 changes: 1 addition & 1 deletion apps/dav/tests/travis/carddav/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onf

RESULT=$?

tail "$/../../../../../data-autotest/owncloud.log"
tail "$/../../../../../data-autotest/nextcloud.log"

exit $RESULT
2 changes: 1 addition & 1 deletion build/integration/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ kill $PHPPID
kill $PHPPID_FED

if [ -z $HIDE_OC_LOGS ]; then
tail "../../data/owncloud.log"
tail "../../data/nextcloud.log"
fi

exit $RESULT
Expand Down
6 changes: 3 additions & 3 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
*/

/**
* By default the Nextcloud logs are sent to the ``owncloud.log`` file in the
* By default the Nextcloud logs are sent to the ``nextcloud.log`` file in the
* default Nextcloud data directory.
* If syslogging is desired, set this parameter to ``syslog``.
* Setting this parameter to ``errorlog`` will use the PHP error_log function
Expand All @@ -559,9 +559,9 @@

/**
* Log file path for the Nextcloud logging type.
* Defaults to ``[datadirectory]/owncloud.log``
* Defaults to ``[datadirectory]/nextcloud.log``
*/
'logfile' => '/var/log/owncloud.log',
'logfile' => '/var/log/nextcloud.log',

/**
* Loglevel to start logging at. Valid values are: 0 = Debug, 1 = Info, 2 =
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Log/OwnCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$output->writeln('Log backend ownCloud: '.$enabledText);

$dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data');
$defaultLogFile = rtrim($dataDir, '/').'/owncloud.log';
$defaultLogFile = rtrim($dataDir, '/').'/nextcloud.log';
$output->writeln('Log file: '.$this->config->getSystemValue('logfile', $defaultLogFile));

$rotateSize = $this->config->getSystemValue('log_rotate_size', 0);
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function ($success) use($output, $updateStepEnabled, $self) {
//Possible scenario: ownCloud core is updated but an app failed
$output->writeln('<warning>ownCloud is in maintenance mode</warning>');
$output->write('<comment>Maybe an upgrade is already in process. Please check the '
. 'logfile (data/owncloud.log). If you want to re-run the '
. 'logfile (data/nextcloud.log). If you want to re-run the '
. 'upgrade procedure, remove the "maintenance mode" from '
. 'config.php and call this script again.</comment>'
, true);
Expand Down
2 changes: 1 addition & 1 deletion issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Insert your webserver log here
```
</details>

#### Nextcloud log (data/owncloud.log)
#### Nextcloud log (data/nextcloud.log)
<details>
<summary>Nextcloud log</summary>
```
Expand Down
4 changes: 2 additions & 2 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,8 @@ public static function registerLogRotate() {
$systemConfig = \OC::$server->getSystemConfig();
if ($systemConfig->getValue('installed', false) && $systemConfig->getValue('log_rotate_size', false) && !self::checkUpgrade(false)) {
//don't try to do this before we are properly setup
//use custom logfile path if defined, otherwise use default of owncloud.log in data directory
\OCP\BackgroundJob::registerJob('OC\Log\Rotate', $systemConfig->getValue('logfile', $systemConfig->getValue('datadirectory', OC::$SERVERROOT . '/data') . '/owncloud.log'));
//use custom logfile path if defined, otherwise use default of nextcloud.log in data directory
\OCP\BackgroundJob::registerJob('OC\Log\Rotate', $systemConfig->getValue('logfile', $systemConfig->getValue('datadirectory', OC::$SERVERROOT . '/data') . '/nextcloud.log'));
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/private/Log/Owncloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* logging utilities
*
* Log is saved at data/owncloud.log (on default)
* Log is saved at data/nextcloud.log (on default)
*/

class Owncloud {
Expand All @@ -44,7 +44,7 @@ class Owncloud {
*/
public static function init() {
$systemConfig = \OC::$server->getSystemConfig();
$defaultLogFile = $systemConfig->getValue("datadirectory", \OC::$SERVERROOT.'/data').'/owncloud.log';
$defaultLogFile = $systemConfig->getValue("datadirectory", \OC::$SERVERROOT.'/data').'/nextcloud.log';
self::$logFile = $systemConfig->getValue("logfile", $defaultLogFile);

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Core/Command/Log/OwnCloudTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function testGetConfiguration() {
->will($this->returnValueMap([
['log_type', 'owncloud', 'log_type_value'],
['datadirectory', \OC::$SERVERROOT.'/data', '/data/directory/'],
['logfile', '/data/directory/owncloud.log', '/var/log/owncloud.log'],
['logfile', '/data/directory/nextcloud.log', '/var/log/nextcloud.log'],
['log_rotate_size', 0, 5 * 1024 * 1024],
]));

Expand All @@ -110,7 +110,7 @@ public function testGetConfiguration() {
->with('Log backend ownCloud: disabled');
$this->consoleOutput->expects($this->at(1))
->method('writeln')
->with('Log file: /var/log/owncloud.log');
->with('Log file: /var/log/nextcloud.log');
$this->consoleOutput->expects($this->at(2))
->method('writeln')
->with('Rotate at: 5 MB');
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static protected function tearDownAfterClassCleanFileCache(IQueryBuilder $queryB
*/
static protected function tearDownAfterClassCleanStrayDataFiles($dataDir) {
$knownEntries = array(
'owncloud.log' => true,
'nextcloud.log' => true,
'owncloud.db' => true,
'.ocdata' => true,
'..' => true,
Expand Down
6 changes: 3 additions & 3 deletions tests/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ cat $BASEDIR/config/config.php
echo "data directory:"
ls -ll $DATADIR

echo "owncloud.log:"
[ -f "$DATADIR/owncloud.log" ] && cat $DATADIR/owncloud.log
[ -f "$BASEDIR/data/owncloud.log" ] && cat $BASEDIR/data/owncloud.log
echo "nextcloud.log:"
[ -f "$DATADIR/nextcloud.log" ] && cat $DATADIR/nextcloud.log
[ -f "$BASEDIR/data/nextcloud.log" ] && cat $BASEDIR/data/nextcloud.log

cd $BASEDIR