ca-apm-probe
Version:
CA APM Node.js Agent monitors real-time health and performance of Node.js applications
42 lines (36 loc) • 1.51 kB
JavaScript
/**
* Copyright (c) 2015 CA. All rights reserved.
*
* This software and all information contained therein is confidential and proprietary and
* shall not be duplicated, used, disclosed or disseminated in any way except as authorized
* by the applicable license agreement, without the express written permission of CA. All
* authorized reproductions must be marked with this language.
*
* EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT
* PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS SOFTWARE WITHOUT WARRANTY
* OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL CA BE
* LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR
* INDIRECT, FROM THE USE OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, LOST
* PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF CA IS
* EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
*/
// Post install script to create logs folder with write permissions
var fs = require('fs');
var path = require('path');
var dir = './logs';
try {
fs.mkdirSync(dir);
try {
fs.chmodSync(dir, 0777);
} catch (e) {
var message = e.toString() || e.message || '';
console.error("[CA APM PROBE] Error while updating permissions for logs dir: " + message);
}
} catch (e) {
if (e.code == 'EEXIST') {
}
else {
console.error("[CA APM PROBE] Could not create logs directory.");
}
}