According to the OED, the noun soliloquy has the following meanings:
a. An instance of talking to or conversing with oneself, or of uttering one's thoughts
aloud without addressing any person.
b. A literary production representing or imitating a discourse of this nature.
2. Without article: the act of talking to oneself; soliloquizing.
The verb soliloquize has these meanings:
1. intr. To engage in soliloquy; to talk to oneself.
a. To utter in soliloquy.
1854 Fraser's Mag. 50 72 Balder soliloquises his ambition.
b. To address or apostrophize in soliloquy.
1823 New Monthly Mag. 7 332 When you are soliloquizing the moon.
I gave two more uncommon of the many usage examples.
So if someone "soliloquizes", they either talk or write to themselves, address an inanimate object (Hamlet's skull), or write in the literary genre of the soliloquy. The context should make clear, what exactly the character does.
In a sense, writing a diary could be understood as soliloquizing: Soliloquy of a Farmer's Wife. The Diary of Annie Elliott Perrin.
In a drama, a monologue, a soliloquy and an aside are differentiated thus:
- monologue is long, breaking the back and forth of normal conversation, but it is addressed at other characters (who may be off stage, e.g. on the telephone)
- during a soliloquy, which may be long or only a few words, the speaker is alone on the stage
- an aside is addressed at the audience
A short soliloquy would be one of two characters exiting the stage, the remaining character uttering: "Well, there he goes ...," and the next charactering coming onto the stage.
The most famous soliloquy is probably the "to be or not to be"-speech in Shakespeare's Hamlet.