Logger does not work on Android, but works on browser


#1

Logger does not create log file on Android device. But on browser it works correctly.
Could you please help me with current issue?

My simple example on Github is here…

app.js

. . .

.controller('Main', ['$scope', '$fileLogger', function($scope, $fileLogger) {

$scope.func = function() {
  // fileDir = cordova.file.externalDataDirectory.replace(cordova.file.externalRootDirectory, '');
  // var filePath = window.cordova.file.externalRootDirectory + "myLog.txt";
  $fileLogger.setStorageFilename("myLog.txt");
  $fileLogger.debug('...debug...');
  $fileLogger.info('...info...');
  $fileLogger.warn('...warn...');
  $fileLogger.error('...error...');
  $fileLogger.log('error', 'error message', { code: 1, meaning: 'general' });
  $fileLogger.log('info', 'message', 123, [1, 2, 3], { a: 1, b: '2' });
};

}])

. . .

#2

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/