The base of a good onion soup is lots of caramelised onion, and the easiest way to do this is with a slow-cooker. Slice about a kilo of onions (bearing in mind that if you’re using this for soup, you don’t want pieces that are so long they’ll be difficult to eat), then add them to a slow cooker on high setting, with a little salt and pepper. Leave it on the high setting til the juice starts to leech from the onions, then put the lid on, turn down to low, and cook for several hours. (If you’re going to be around during the cooking process, you may find the results are better if you leave the lid off and stir every hour or so.) You won’t need any oil as the onions will be effectively cooking in their own juices.
When the onions are soft, turn the heat back to high, stir in a couple of spoonfuls of flour and a good amount of butter, and cook the flour out for around 20 minutes. Add about a litre of stock (traditionally beef stock but I used chicken), stir well to incorporate the roux into the stock, and cook until the soup thickens. Season to taste. Meanwhile, toast some sourdough. Pour the soup into bowls, put the toasted sourdough in the soup, top with grated cheese (traditionally Gruyere, but I used a combination of pecorino and blue as that’s what was in the fridge) and put the bowls under the grill til the cheese is melted and browned.