You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
1.0 KiB

7 days ago
// 检查起服状态:日志尾部 + 8080 端口探测
import { readFileSync, statSync } from 'node:fs';
import { createConnection } from 'node:net';
const LOG = 'logs/crm-app.log';
const st = statSync(LOG);
console.log('log mtime:', st.mtime.toISOString());
const lines = readFileSync(LOG, 'utf8').split(/\r?\n/).filter(Boolean);
console.log('--- last 15 lines ---');
for (const l of lines.slice(-15)) console.log(l);
const started = lines.filter(l => l.includes('Started CrmAppApplication')).length;
console.log('---');
console.log('Started marker count:', started, '(whole file)');
console.log('verify profile banner:', lines.some(l => l.includes('profile') && l.includes('verify')) ? 'yes' : 'not-found-in-tail');
const sock = createConnection({ host: '127.0.0.1', port: 8080, timeout: 2000 });
sock.on('connect', () => { console.log('port 8080: OPEN'); sock.destroy(); });
sock.on('error', e => console.log('port 8080: CLOSED (' + e.code + ')'));
sock.on('timeout', () => { console.log('port 8080: TIMEOUT'); sock.destroy(); });