Command: JBoss domain server log directory
774217
def jboss_domain_server_log_dir(broker):
        """"""
        ps = broker[DefaultSpecs.ps_auxww].content
        results = []
        findall = re.compile(r"\-Djboss\.server\.log\.dir=(\S+)").findall
        # JBoss domain server progress command content should contain jboss.server.log.dir
        for p in ps:
            if '-D[Server:' in p:
                found = findall(p)
                if found:
                    # Only get the path which is absolute
                    results.extend(f for f in found if f[0] == '/')
        return list(set(results))
1123356
def get_log_list_data(self, domains, log_date):
        
        req = {}
        req.update({"domains": ';'.join(domains)})
        req.update({"day": log_date})

        body = json.dumps(req)
        url = '{0}/v2/tune/log/list'.format(self.server)
        return self.__post(url, body)
986910
private static void outputHelp() {
        System.out.println("Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>");
        System.out.println("where options include:");
        System.out.println("   -srcdir <directory>   Where to find source directories (required)");
        System.out.println("   -dstdir <directory>   Where to output generated files (default srcdir)");
        System.out.println("   -version <version>    Specify the version, such as 2009a (optional)");
        System.out.println("   -unpacked             Generate dat files without jar files");
        System.out.println("   -help                 Print this usage message");
        System.out.println("   -verbose              Output verbose information during compilation");
        System.out.println(" There must be one directory for each version in srcdir");
        System.out.println(" Each directory must have the name of the version, such as 2009a");
        System.out.println(" Each directory must contain the unpacked tzdb files, such as asia or europe");
        System.out.println(" Directories must match the regex [12][0-9][0-9][0-9][A-Za-z0-9._-]+");
        System.out.println(" There will be one jar file for each version and one combined jar in dstdir");
        System.out.println(" If the version is specified, only that version is processed");
    }
217505
private static void setCommandLogInfo(Catalog catalog, CommandLogType commandlog) {
        int fsyncInterval = 200;
        int maxTxnsBeforeFsync = Integer.MAX_VALUE;
        org.voltdb.catalog.CommandLog config = catalog.getClusters().get("cluster").getLogconfig().get("log");
        if (config == null) {
            config = catalog.getClusters().get("cluster").getLogconfig().add("log");
        }

        Frequency freq = commandlog.getFrequency();
        if (freq != null) {
            long maxTxnsBeforeFsyncTemp = freq.getTransactions();
            if (maxTxnsBeforeFsyncTemp < 1 || maxTxnsBeforeFsyncTemp > Integer.MAX_VALUE) {
                throw new RuntimeException("Invalid command log max txns before fsync (" + maxTxnsBeforeFsync
                        + ") specified. Supplied value must be between 1 and (2^31 - 1) txns");
            }
            maxTxnsBeforeFsync = (int)maxTxnsBeforeFsyncTemp;
            fsyncInterval = freq.getTime();
            if (fsyncInterval < 1 | fsyncInterval > 5000) {
                throw new RuntimeException("Invalid command log fsync interval(" + fsyncInterval
                        + ") specified. Supplied value must be between 1 and 5000 milliseconds");
            }
        }
        config.setEnabled(commandlog.isEnabled());
        config.setSynchronous(commandlog.isSynchronous());
        config.setFsyncinterval(fsyncInterval);
        config.setMaxtxns(maxTxnsBeforeFsync);
        config.setLogsize(commandlog.getLogsize());
    }
437647
def serverDirectories(self):
        """"""
        directs = []
        url = self._url + "/directories"
        params = {
            "f" : "json"
        }
        res = self._get(url=url,
                           param_dict=params,
                           securityHandler=self._securityHandler,
                           proxy_url=self._proxy_url,
                           proxy_port=self._proxy_port)
        for direct in res['directories']:
            directs.append(
                ServerDirectory(url=url + "/%s" % direct["name"],
                                securityHandler=self._securityHandler,
                                proxy_url=self._proxy_url,
                                proxy_port=self._proxy_port,
                                initialize=True))
        return directs
1296928
def _log_tc_proxy(self):
        """"""
        if self.default_args.tc_proxy_tc:
            self.log.info(
                u'Proxy Server (TC): {}:{}.'.format(
                    self.default_args.tc_proxy_host, self.default_args.tc_proxy_port
                )
            )
11658
public void writeConfiguration(final OperationContext context) {
        final String loggingConfig;
        switch (context.getProcessType()) {
            case DOMAIN_SERVER: {
                loggingConfig = FileResolver.resolvePath(context, "jboss.server.data.dir", PROPERTIES_FILE);
                break;
            }
            case STANDALONE_SERVER: {
                loggingConfig = FileResolver.resolvePath(context, "jboss.server.config.dir", PROPERTIES_FILE);
                break;
            }
            default: {
                /*
                For every case other than domain or standalone servers, (embedded, appclient etc.) this leave loggingConfig
                unset and returns. Allowing the config to be set here, will result in the respective {standalone|domain}/configuration/
                logging.properties being overwritten with a basic empty logging template, which may cause unexpected and missing logging
                output on the next startup. (This is caused in the embedded case by nothing being committed on the LogContext being used.)
                */
                return;
            }
        }
        if (loggingConfig == null) {
            LoggingLogger.ROOT_LOGGER.warn(LoggingLogger.ROOT_LOGGER.pathManagerServiceNotStarted());
        } else {
            final File configFile = new File(loggingConfig);
            synchronized (LOCK) {
                try {
                    // Commit the log context configuration
                    commit();
                    FileOutputStream out = null;
                    try {
                        out = new FileOutputStream(configFile);
                        final FileLock lock = out.getChannel().lock();
                        try {
                            out.write(NOTE_MESSAGE);
                            config.writeConfiguration(out);
                        } finally {
                            // The write should close the stream which would release the lock this check ensures the
                            // lock will be released
                            if (lock.isValid()) {
                                lock.release();
                            }
                        }
                        LoggingLogger.ROOT_LOGGER.tracef("Logging configuration file '%s' successfully written.", configFile.getAbsolutePath());
                    } catch (IOException e) {
                        throw LoggingLogger.ROOT_LOGGER.failedToWriteConfigurationFile(e, configFile);
                    } finally {
                        safeClose(out);
                    }
                } finally {
                    forget();
                }
            }
        }
    }
514265
public void doMain(String[] args)
    {
        int firstFileIndex = processOptions(args);

        int fileCount = args.length - firstFileIndex;
        String[] files = new String[fileCount];
        System.arraycopy(args, firstFileIndex, files, 0, fileCount);

        if (optionsAreValid(files))
        {
            processFiles(files);
        }
    }
516337
public static void i(com.couchbase.lite.LogDomain domain, String msg) {
        sendToLoggers(com.couchbase.lite.LogLevel.INFO, domain, msg);
    }
1027544
private void logJavaInfo() {
        log("Operating system: " + VersionFinder.getProperty("os.name") + " "
                + VersionFinder.getProperty("os.version") + " " + VersionFinder.getProperty("os.arch"));
        log("Java version: " + VersionFinder.getProperty("java.version") + " / "
                + VersionFinder.getProperty("java.runtime.version") + " ("
                + VersionFinder.getProperty("java.vendor") + ")");
        log("Java home: " + VersionFinder.getProperty("java.home"));
        final String jreRtJarPath = SystemJarFinder.getJreRtJarPath();
        if (jreRtJarPath != null) {
            log("JRE rt.jar:").log(jreRtJarPath);
        }
    }
207139
def setup_prefix_logging(logdir):
    
    if not os.path.exists(logdir):
        os.mkdir(logdir)

    file_handler = logging.FileHandler(
        filename=os.path.join(logdir, 'lago.log'),
    )
    file_formatter = get_default_log_formatter()
    file_handler.setFormatter(file_formatter)
    logging.root.addHandler(file_handler)
    hide_paramiko_logs()
    hide_stevedore_logs()
186297
public function save($log_dir = '')
    {
        if (empty($log_dir)) {
            $log_dir = \ROOT . '/private/logs/syslog/';
        }

        if (!is_dir($log_dir)) {
            mkdir($log_dir, 0777, true);
        }

        return file_put_contents($log_dir . date('Y_m_d') . '.log',
                $this->message . "\n", \FILE_APPEND);
    }
226285
def lookup_domains(self):
        
        thread_error = False
        thread_wait_timeout = 200
        ind = 1
        total_item_count = len(self.domains)
        for domain in self.domains:
            for nameserver in self.nameservers:
                wait_time = 0
                while threading.active_count() > self.max_threads:
                    time.sleep(1)
                    wait_time += 1
                    if wait_time > thread_wait_timeout:
                        thread_error = True
                        break

                if thread_error:
                    self.results["error"] = "Threads took too long to finish."
                    break
                log_prefix = "%d/%d: " % (ind, total_item_count)
                thread = threading.Thread(target=self.lookup_domain,
                                          args=(domain, nameserver,
                                                log_prefix))
                thread.setDaemon(1)

                thread_open_success = False
                retries = 0
                while not thread_open_success and retries < MAX_THREAD_START_RETRY:
                    try:
                        thread.start()
                        self.threads.append(thread)
                        thread_open_success = True
                    except:
                        retries += 1
                        time.sleep(THREAD_START_DELAY)
                        logging.error("%sThread start failed for %s, retrying... (%d/%d)" % (log_prefix, domain, retries, MAX_THREAD_START_RETRY))

                if retries == MAX_THREAD_START_RETRY:
                    logging.error("%sCan't start a new thread for %s after %d retries." % (log_prefix, domain, retries))

            if thread_error:
                break
            ind += 1

        for thread in self.threads:
            thread.join(self.timeout * 3)
        return self.results
1337837
private String logIdent() {
        if (alternate != null) {
            return "[" + hostname.nameAndAddress() + " (" + alternate.nameAndAddress() + ")]: ";
        } else {
            return "[" + hostname.nameAndAddress() + "]: ";
        }
    }
512121
def log_paths():
    ''''''
    if opts.aircraft is not None:
        dirname = ""
        if opts.mission is not None:
            print(opts.mission)
            dirname += "%s/logs/%s/Mission%s" % (opts.aircraft, time.strftime("%Y-%m-%d"), opts.mission)
        else:
            dirname += "%s/logs/%s" % (opts.aircraft, time.strftime("%Y-%m-%d"))
        # dirname is currently relative.  Possibly add state_basedir:
        if mpstate.settings.state_basedir is not None:
            dirname = os.path.join(mpstate.settings.state_basedir,dirname)
        mkdir_p(dirname)
        highest = None
        for i in range(1, 10000):
            fdir = os.path.join(dirname, 'flight%u' % i)
            if not os.path.exists(fdir):
                break
            highest = fdir
        if mpstate.continue_mode and highest is not None:
            fdir = highest
        elif os.path.exists(fdir):
            print("Flight logs full")
            sys.exit(1)
        logname = 'flight.tlog'
        logdir = fdir
    else:
        logname = os.path.basename(opts.logfile)
        dir_path = os.path.dirname(opts.logfile)
        if not os.path.isabs(dir_path) and mpstate.settings.state_basedir is not None:
            dir_path = os.path.join(mpstate.settings.state_basedir,dir_path)

        logdir = dir_path

    mkdir_p(logdir)
    return (logdir,
            os.path.join(logdir, logname),
            os.path.join(logdir, logname + '.raw'))
1307215
private void logScanInfo() {
        StringBuilder strBuilder = new StringBuilder(150);
        if (nodeInScopeCount != 0) {
            strBuilder.append("Scanning ");
            strBuilder.append(nodeInScopeCount);
            strBuilder.append(" node(s) ");
        } else {
            strBuilder.append("No nodes to scan ");
        }
        if (parentScanner.getJustScanInScope()) {
            strBuilder.append("[just in scope] ");
        }
        strBuilder.append("from ").append(hostAndPort);
        if (user != null) {
            strBuilder.append(" as ");
            strBuilder.append(user.getName());
        }
        if (nodeInScopeCount == 0) {
            strBuilder.append(", skipping all plugins.");
        }
        log.info(strBuilder.toString());
    }
74441
def cli():
    
    ch = logging.StreamHandler()
    ch.setFormatter(logging.Formatter(
        '%(asctime)s.%(msecs)03d %(levelname)s: %(message)s',
        datefmt="%Y-%m-%d %H:%M:%S"
    ))
    logger.addHandler(ch)

    import argparse
    parser = argparse.ArgumentParser(description="Search 'network' for hosts with a \
    response to 'path' that matches 'filter'")
    parser.add_argument('network', help='IP address with optional mask, e.g. 192.168.0.0/24')
    parser.add_argument('-p', '--path', help='URL path at host, e.g. index.html',
        default='')
    parser.add_argument('-f', '--filter', help='Regular expression pattern for filter',
        dest='pattern', default='')
    parser.add_argument('-l', '--log', help='Enable logging', action='store_true')
    args = parser.parse_args()
    print('Scanning, please wait ...')
    result = survey(**vars(args))
    print('Found {} match{}{}{} on {}'.format(len(result), 'es' if len(result)!=1 else '',
        ' for ' if args.pattern else '', args.pattern, args.network))
    for x in result:
        print(x.hostname)