18 Commits

Author SHA1 Message Date
Julian Oes
1a96bd2c94
feat(logger): add SDLOG_ROTATE, disentangle cleanup thresholds
The previous cleanup logic conflated two independent concerns into
SDLOG_MAX_SIZE: the maximum size of a single log file (rotation
trigger) AND the minimum free space to maintain. That was broken:
the 4095 MB default meant "keep 4 GB free", which over-cleaned on
large SD cards and was impossible to satisfy on small flash.

Disentangle the two:

- SDLOG_ROTATE (new, int %, default 90): maximum disk usage percentage.
  Cleanup guarantees at least (100 - SDLOG_ROTATE)% free even during
  writing of a new log file. Setting 0 disables space-based cleanup;
  100 allows filling the disk completely.
- SDLOG_MAX_SIZE (default lowered from 4095 to 1024): pure max file
  size. The value is added on top of the rotate-derived threshold as
  headroom for the next file write, so the rotate guarantee holds
  even mid-write.
- SDLOG_DIRS_MAX: removed. Directory count limits were confusing and
  orthogonal to the space-management goal; free-space cleanup alone
  covers the use case. Drop the param and all remaining overrides
  (rc.board_defaults, rcS, rc.replay, 1002_standard_vtol.hil).

Cleanup threshold is now:
    ((100 - SDLOG_ROTATE)% of disk) + SDLOG_MAX_SIZE

Small-flash boards can override SDLOG_MAX_SIZE to get more retained
logs within the available space. kakuteh7v2 and airbrainh743 drop
their SDLOG_DIRS_MAX overrides accordingly.

Update docs/en/dev_log/logging.md with the new semantics and a
worked example for the typical 8 GB SD case.
2026-04-11 06:35:58 +12:00
Julian Oes
5762d72004
feat(logger): add support for small flash storage
Move log cleanup from boot to log start, delete individual .ulg files
(oldest first) instead of entire directories, and add a max log file
size. This makes it practical to run the logger on small flash targets
(e.g. 128 MB W25N NAND) while still allowing logs to be downloaded via
MAVLink FTP before they are removed.

- Move cleanup from boot to log start so logs can be downloaded first.
- Delete individual .ulg files (oldest first) instead of whole dirs.
- Add SDLOG_MAX_SIZE parameter (default 4095 MiB, just under FAT32 limit).
- Prioritize directories from the naming scheme not currently in use
  (e.g. delete sess dirs first when using date dirs).
- Simplify get_log_time to rely on clock_gettime (GPS driver sets it).
- Safer string handling in directory parsing.
- Log elapsed cleanup time for diagnostics.
- Split pure parsing helpers into util_parse.{h,cpp} and add unit tests
  (loggerUtilTest.cpp). Move px4_add_unit_gtest outside the BUILD_TESTING
  guard for consistency with the rest of the tree; the macro already
  checks BUILD_TESTING internally.

Sponsored by CubePilot.
2026-04-11 05:58:49 +12:00
Hamish Willee
b37733459d
docs: Codespell check on English sources + swd fixes (#26657) 2026-03-05 12:50:59 +11:00
Hamish Willee
c0af8b9952
docs: Link fixes such as 301 redirects (#26586) 2026-02-26 18:33:37 +11:00
PX4BuildBot
36b5e1e1bb docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-11 22:43:01 +00:00
Edvard Sire
585a615e64 Fix typo in OS version field name 2025-11-24 09:23:17 -09:00
Matthias Grob
12035682d7
Use MAVLink v1 only as opt-in (#25583)
* Remove support for MAVLink 1

* Add back support for MAVLink 1 but don't default to it

* Update src/modules/mavlink/mavlink_params.c

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>

---------

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-10-13 20:58:34 -08:00
annoybot
a443997264
docs: add a new rust ULOG parser to the list of known parsers 2025-10-06 09:11:54 +02:00
Hamish Willee
bec570b3b4
Update ULog file format documentation (#25624)
Added information about tools for converting ULog to other formats.
2025-09-25 11:02:16 +10:00
Alexander Lerach
8f2c36689d
logging: allow logging backend config
* logging: allow logging backend config

* correct board comments

* documentation: updated logging section
2025-08-27 15:44:36 +02:00
Hamish Willee
dd0dcbb82c
Link fixes - mostly redirects (#25186) 2025-07-10 17:35:07 +10:00
Hamish Willee
2c31e2bad5
Fix all possible HTTP to HTTPS docs links (#25153) 2025-07-03 18:09:58 +10:00
Matthias Grob
2bc04f91f8 docs: fix all end of file newlines
Note: Some files are autogenerated and I did not yet
go through each source of generation to fix it there.
Instead I adjusted the filter to only exclude those
such that we can fix things in steps.
2025-06-26 11:03:23 -07:00
Hamish Willee
3a4dc784eb Fix up badges refering to main/v116 to just be 116 2025-06-04 12:39:33 +10:00
Roman Shtylman
fed1b338c0
Update ulog_file_format.md (#24809)
* Update ulog_file_format.md

Update Known Parser Implementations with updated information for Foxglove and the typescript parser

* Update docs/en/dev_log/ulog_file_format.md
2025-05-07 08:59:22 +10:00
Patrik Dominik Pordi
03345db36e
Added Flight REview for Encrypted logs (#24690)
* Added Flight REview for Encrypted logs

* Subedit

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-04-09 10:37:14 +10:00
Patrik Dominik Pordi
1ee3b7e77d
[Pending] Updated Encrypted logs docs to reflect #24489 , (#24580)
* Updated Encrypted logs docs to reflect https://github.com/PX4/PX4-Autopilot/pull/24489

* Subedit

* Subedit the key generation bit

* Updated the docs with multiple command line args for the decryptor and added OpenSSL as a requirement

* Subedit

* Update log_encryption.md

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-04-04 07:36:35 +11:00
Hamish Willee
88d623bedb
Move PX4 Guide source into /docs (#24490)
* Add vitepress tree

* Update existing workflows so they dont trigger on changes in the docs path

* Add nojekyll, package.json, LICENCE etc

* Add crowdin docs upload/download scripts

* Add docs flaw checker workflows

* Used docs prefix for docs workflows

* Crowdin obvious fixes

* ci: docs move to self hosted runner

runs on a beefy server for faster builds

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci: don't run build action for docs or ci changes

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci: update runners

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* Add docs/en

* Add docs assets and scripts

* Fix up editlinks to point to PX4 sources

* Download just the translations that are supported

* Add translation sources for zh, uk, ko

* Update latest tranlsation and uorb graphs

* update vitepress to latest

---------

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
2025-03-13 16:08:27 +11:00