An array index out of bounds is not something the language can detect in C or C++,
Partly correct, but missing the point. If you're actually writing C++, instead of just throwing your C code into a class, you won't be using an "array". The standard library comes with good number of excellent data structures, and you'll be using one of those instead. If you do actually need an array, you'll use a vector. A vector will throw if you access if out of bounds using ".at". You will also design your program so you're not using integer indexes into containers unless you absolutely have to.
but safe containers can be done and are available in C as well.
If you define "safe" as "still crashing the program if you do it wrong", then yes. They can be made safe. But in C++ they can throw an exception, which you can catch at a higher level, and generate some helpful output. If your program crashes, anywhere, ever, then it is probably exploitable.
Also, since when do C++ code come with a standard, always present way to log errors to a file? It does not.
The de-facto standard for logging output exists in C, C++, and any other language that runs on a unix system - I assume we're talking mostly about unix here. It's called "standard output" and "standard error". It will go to a file if you run your process as a service, otherwise it will go to the console. That should be good enough for anybody.