mime-db icon indicating copy to clipboard operation
mime-db copied to clipboard

Add log files support

Open ChaosAttractor opened this issue 8 months ago • 2 comments

ChaosAttractor avatar May 13 '25 08:05 ChaosAttractor

Can you give us more information about this MIME?

bjohansebas avatar May 15 '25 19:05 bjohansebas

I apologize for the wait.

.log files are associated with text/x-log if the file implements Express.Multer.File (express, nest.js file handler)

image

and text/plain if

file --mime-type -b test.log
# output will be text/plain and inode/x-empty if file is empty

or

import path from 'path';
import mime from 'mime-types';

const ext = path.extname('./test.log');
const mimetype = mime.lookup(ext);

console.log(ext, mimetype);

ChaosAttractor avatar Aug 06 '25 08:08 ChaosAttractor