file in abyss
フォーマット一覧へ戻る

Data

LOG Log File

アプリケーションやサーバーのイベント記録に使われるテキストログ。固定の標準シグネチャはありません。

Extensions .log
MIME text/plain

マジックナンバー

ファイルを解析
オフセット 0 ISO日時で始まるログサンプル
32 30 32 36 2D
2026-

構造

  1. Timestamp
  2. Level
  3. Fields
  4. Message

注意点

  • ログ形式は製品や設定で大きく異なるため、固定マジックナンバーでは判定できません。

判定コード例

SIGNATURE = bytes.fromhex("323032362d")
OFFSET = 0

def is_log(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

Log File はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。

よくある判定ミス

  • .log という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • Log File は 32 30 32 36 2D のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。

サンプルの活用

11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Data

Blue Sky LOG

Blue Sky LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.log
Type Sample
Small file
86 B
SHA-256 981d51a3269c3b7eecc126dc91cafbf5c6ec75c9dd4ae2a550946c8324f3d9ac
Download
Data

Flower Garden LOG

Flower Garden LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.log
Type Sample
Small file
200 B
SHA-256 6a81a7f923919c8240626c0710455508fc2460e18c9a549d5539f38796eab3f8
Download
Data

Navy Blue Sky LOG

Navy Blue Sky LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.log
Type Sample
Small file
273 B
SHA-256 5317ae9ea98d825c7c92aeed7e8aeb597408fc7b97c506a58592f681216cef46
Download
Data

Nature of the Sky LOG

Nature of the Sky LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.log
Type Sample
Small file
340 B
SHA-256 a3f7e620081be4fca79a3617393a9cb6dcc70cf2730d38be3ad4ff57673e9b23
Download
Data

Sky Landscape LOG

Sky Landscape LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.log
Type Sample
Small file
530 B
SHA-256 476b956e6276ab49c2e95d1a2dc9a96eb8183ad94512b947cedef2d4a83aaed9
Download
Data

Starry Sky LOG

Starry Sky LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.log
Type Sample
Small file
510 B
SHA-256 1c0aa7176033ae184031a522569a845f3172cc5e40440d5068e5d035425c5cd4
Download
Data

Blue Night Sky LOG

Blue Night Sky LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.log
Type Sample
Small file
623 B
SHA-256 3127d5c1d54cf058860639d939114b24723496e4664f32d049571575626de3c3
Download
Data

Hibiscus Flower LOG

Hibiscus Flower LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.log
Type Sample
Small file
816 B
SHA-256 d6365998f74a2bb0141106ab8dc1433ece30013ba42fbcf118468fe671203380
Download
Data

Arctic Sky LOG

Arctic Sky LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.log
Type Sample
Small file
792 B
SHA-256 3562c18f5a5944750c85a708d5a057a84dbba7e760ae8742df482be2ad89a117
Download
Data

Sunset Rays LOG

Sunset Rays LOG is a Log File sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.log
Type Sample
Small file
950 B
SHA-256 25471eafd854d7fba17b9b89f6ffe92119505657dbee7cc78a331706e3f92a44
Download
Data

NASA Blue Marble LOG

NASA Blue Marble LOG is a Log File sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.log
Type Sample
1.6 KB
SHA-256 750093230bfb21458ee8db92863dab9485f2bc97f83214dd5c00a2b8b52c22e0
Download

よくある質問

Log File のマジックナンバー(ファイルシグネチャ)は?

Log File ファイルはバイトシグネチャ 32 30 32 36 2D ("2026-") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Log File のMIMEタイプは?

Log File のMIMEタイプは text/plain です。

Log File の拡張子は?

Log File ファイルは .log 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット