For "archive logging" (aka "log retain") you define how many active logs will be kept (primary and secondary). Secondary active logs are only used when a UOW goes beyond the primary log allocation without a commit.
Once the active logs are filled, they are archived to the archive log location (specified in an exit program or using LOGARCHMETH1 & 2 (spelling may be wrong). Certain other kinds of events may cause the logs to be truncated (start a new log file) or archived.
You must manually prune the archive logs or they will stay on the archive log path forever.
The log buffer is not specifically associated with archiving or circular logs (all logs are written to a memory buffer before they are written to disk). Logs are flushed to disk when:
- A commit is issued (so that DB2 gurantees UOW recovery),
- The log buffer is full, or
- About one second has elapsed since the last logs were flushed to disk.
There are some exceptions to what is said above, especially with TSM, but given that you are apparently new to DB2 internals, don't try to understand everything at once. Also, I would suggest you read the Administraton Guides for more information.